<style type="text/css">
#container {
overflow: auto;
}
.image {
width: 50px;
height: 50px;
float: left;
position: relative;
}
a.delete {
display: block;
position: absolute;
top: 0;
right: 0;
width: 10px;
height: 10px;
text-indent: -999px;
background: red;
}
.image:hover a.delete {
display: block;
}
</style>
<script type="text/javascript">//<![CDATA[
$(window).load(function () {
$(document).ready(function () {
//$('a.delete').on('click', function (e)
$(document).on("click",".delete",function(e){
{
alert('sudhir');
e.preventDefault();
imageID = $(this).closest('.tb')[0].id;
alert('Deleting Object "' + imageID + '"');
$(this).closest('.tb')
.fadeTo(300, 0, function () {
$(this)
.animate({ width: 0 }, 200, function () {
$(this)
.remove();
});
});
});
});
});//]]>
</script>
<style>
#divContainer, #divResize {
border: dashed 1px #CCC;
width: 30px;
height: 30px;
padding: 5px;
margin: 5px;
font: 13px Arial;
cursor: move;
float: left;
background-color: transparent;
}
div1 {
background-color: white;
/*background: transparent;*/
border-radius: 100%;
margin-left: 50px;
cursor: move;
}
div {
background-color: white;
/*cursor: move;*/
background: transparent;
}
</style>
<style>
canvas {
border: 10px inset brown;
}
.resizedTextbox {
width: 40px;
height: 30px;
/*cursor: move;*/
}
input[type="text"] {
background: transparent;
border: none;
/*cursor: move;*/
}
</style>
<script>
function popupwindow(url, title, w, h) {
var left = (screen.width / 2) - (w / 2);
var top = (screen.height / 2) - (h / 2);
return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}
var element_pos = 40; // POSITION OF THE NEWLY CREATED ELEMENTS.
var iCnt = 0;
var element_pos1 = 45;
$(document).ready(function () {
var hdnDiv = document.getElementById('ctl00_BodyContent_HdnDivCount');
//alert(hdnDiv);
var HdnDateTime = document.getElementById('ctl00_BodyContent_HdnDateTime');
var tbLabel = document.getElementById('tbLabel');
var ddlHSI = document.getElementById('ddlHSI');
var HdnHSI = document.getElementById('ctl00_BodyContent_HdnHSI');
//alert(tbLabel);
//var ddlTemp = document.getElementById('ddlTemp');
var e = document.getElementById("ctl00_BodyContent_ddlTemp");
//$(function () { $('#divContainer').draggable(); });
//$(function () { $("#divResize").draggable().resizable(); });
// CREATE MORE DIV, WITH 'ABSOLUTE' POSITIONING.
//border: '1px solid', position: 'absolute', left: element_pos,
$('#btClickMe').click(function () {
var dynamic_div = $("<div1 id= div" + iCnt + "><a href='#' class='delete'>sudhir</a></div1>").css({
border: '1px solid', position: 'absolute', left: '350', top: 110,
width: '25', height: '25', url: '', padding: '2', margin: '50',
});
//var dynamic_div = $("<div1 id=div" + iCnt + "></div1>").css({
// border: '1px solid', position: 'absolute', left: '350', top: 110,
// width: '25', height: '25', url: '', padding: '2', margin: '50',
//});
//$(dynamic_div).addClass('ui-draggable');
$(dynamic_div).append('<input type=text readonly=true style="width:28px;font:arial;background-color:transparent;font-size:11px;margin-top:5px;margin-left:-1px;text-align:center;border:0px;" id=tb' + iCnt + ' value=' + e.options[e.selectedIndex].value + '>');
$(dynamic_div).appendTo('#ctl00_BodyContent_divResize').draggable();
iCnt = iCnt + 1;
document.getElementById('ctl00_BodyContent_HdnDivCount').value = iCnt;
});
$('#btDateTime').click(function () {
//alert(document.getElementById('ctl00_BodyContent_HdnDateTime').value);
var dynamic_div1 = $(document.createElement('div')).css({
border: 'none', cursor: 'move', position: 'absolute', background: 'transparent', left: '350',//element_pos1,
top: 65,//$('#ctl00_BodyContent_divResize').height() + 20,
width: '75', height: '100', url: '', padding: '2', margin: '50',
});
//element_pos1 = element_pos1 + $('#ctl00_BodyContent_divResize').width() + 20;
$(dynamic_div1).append('<input type=text readonly=true style="width:170px;background-color:transparent;font:arial;font-size:12px;margin-top:50px;margin-left:-1px;text-align:center;border:0px;" id=tbdatetime' + iCnt + ' value="' + document.getElementById('ctl00_BodyContent_HdnDateTime').value + '">');
$(dynamic_div1).appendTo('#ctl00_BodyContent_divResize').draggable();
iCnt = iCnt + 1;
});
$('#btLabel').click(function () {
var dynamic_div1 = $(document.createElement('div')).css({
border: 'none', cursor: 'move', position: 'absolute', background: 'transparent', left: '350',
top: 36,// $('#ctl00_BodyContent_divResize').height() + 20,
width: '75', height: '100', url: '', padding: '2', margin: '50',
});
element_pos1 = element_pos1 + $('#ctl00_BodyContent_divResize').width() + 20;
$(dynamic_div1).append('<input type=text readonly=true style="width:150px;background-color:transparent;font:arial;font-size:12px;margin-top:90px;margin-top:80px;margin-left:-1px;text-align:center;border:2px;" id=tb' + iCnt + ' value="' + document.getElementById('tbLabel').value + '">');
$(dynamic_div1).appendTo('#ctl00_BodyContent_divResize').draggable();
iCnt = iCnt + 1;
});
$('#ctl00_BodyContent_btHSI').click(function () {
var dynamic_div1 = $(document.createElement('div')).css({
border: 'none', cursor: 'move', position: 'absolute', background: 'transparent', left: '350',
top: 56,// $('#ctl00_BodyContent_divResize').height() + 20,
width: '75', height: '100', url: '', padding: '2', margin: '50',
});
//alert(document.getElementById('ctl00_BodyContent_ddlHSI').value);
element_pos1 = element_pos1 + $('#ctl00_BodyContent_divResize').width() + 20;
//$(dynamic_div1).append('<input type=text readonly=true style="width:150px;background-color:transparent;font:arial;font-size:12px;margin-top:90px;margin-top:80px;margin-left:-1px;text-align:center;border:2px;" id=tb' + iCnt + ' value="' + document.getElementById('tbHSI').value + '">');
$(dynamic_div1).append('<input type=text readonly=true style="width:170px;background-color:transparent;font:arial;font-size:12px;margin-top:50px;margin-left:-1px;text-align:center;border:1px;" id=tbHSI' + iCnt + ' value="' + document.getElementById('ctl00_BodyContent_ddlHSI').value + '">');
$(dynamic_div1).appendTo('#ctl00_BodyContent_divResize').draggable();
iCnt = iCnt + 1;
});
});
</script>
<script type="text/javascript">
Sys.Application.add_load(MyLoad);
function MyLoad(sender) {
//alert(ctl00_BodyContent_divResize.innerHTML);
$get(document.getElementById('ctl00_BodyContent_divResize')).innerHTML += " - text added on client";
}
function GetDivHTML() {
//alert(document.getElementById('HdnDivCount').value);
var hdnDiv = document.getElementById('ctl00_BodyContent_HdnDivContent');
//alert(hdnDiv);
var content = document.getElementById('ctl00_BodyContent_divResize');
hdnDiv.value = content.innerHTML;
//alert(hdnDiv.value);
}
</script>