Hi,
After reading through the documentation, I have a more sensible question about
draggables, overriding the more vague question I asked before. I am trying to
create an area where the draggable can be moved and if it is not moved to this
area, I would prefer it returns to where it is. I found an attribute
"containment" for the draggable. Sadly, my page does not seem to be respecting
the containment. Instead allowing the draggable to be moved anywhere on the
screen, regardless of whether it is in the containment area. Can someone help?
Here is the snippet of HTML / JS code.
<div id="worksheetItems" class="worksheetItems">
<table>
<tr class="worksheetHeader"><td>Available Worksheets</td></tr>
<tr><td id="worksheetItemArea">
<div id="w1"><table>
<tr>
<td><img src="images/pdficon.gif" alt=""
border="0"></td>
<td class="worksheetItem">Worksheet 1</td>
</tr>
</table></div>
</td>
</tr></table>
</div>
<script type="text/javascript">
$(document).ready(
function () {
$('#w1').Draggable(
{
zIndex: 1000,
containment: 'userWIArea',
ghosting: false,
opacity: 0.7
}
);
}
)
</script>
</td>
<td><div id="userWorksheetItems" class="userWorksheetItems">
<table>
<tr class="worksheetHeader"><td>My Custom Worksheet</td></tr>
<tr><td id="userWIArea"></td></tr>
</table>
</div>
</td>
</tr>
</table>
Thanks, - Dave
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/