Drag and drop containers with link anchors using Yahoo API

ananetre

New Member
I modified the excellent Yahoo example to allow drag and drop of div containers.I basically just change all reference to "ul" and "li"s in the code to the classes of the div containers.I want to allow the reordering of images in a gallery.I can reorder the div containers just fine, if they don't contain a link.How can I make those divs draggable?The problem is pretty much the same as adding link anchors to the yahoo example fromhttp://yuilibrary.com/yui/docs/dd/list-drag.html\[code\]<div id="play"> <ul id="list1"> <li class="list1"><a href="http://stackoverflow.com/questions/10603120/#">Item #1</a></li> <li class="list1"><a href="http://stackoverflow.com/questions/10603120/#">Item #2</a></li> <li class="list1"><a href="http://stackoverflow.com/questions/10603120/#">Item #3</a></li> <li class="list1"><a href="http://stackoverflow.com/questions/10603120/#">Item #4</a></li> <li class="list1"><a href="http://stackoverflow.com/questions/10603120/#">Item #5</a></li> </ul></div>\[/code\]I believe the list items would not be draggable in this case, either.So my code looks like this:\[code\]<div class="alt1" style="padding:6px;" width="100%" align="center" id="play"> <div style="width:162px; height:166px; margin:5px; float:left" class="list1"> <a href="http://stackoverflow.com/questions/10603120/album.php?pictureid=147828"><img src="http://stackoverflow.com/123.jpg" alt="" border="0" style="padding:6px;" width="130" height="130" /></a> </div> <div style="width:162px; height:166px; margin:5px; float:left" class="list1"> <a href="http://stackoverflow.com/questions/10603120/album.php?pictureid=147828"><img src="http://stackoverflow.com/123.jpg" alt="" border="0" style="padding:6px;" width="130" height="130" /></a> </div></div>\[/code\]If I add the links (as above), I can only drag the div containers by their padding.If the links are not there, I can drag the images anywhere.
 
Top