How do you drag a link without its parent div attached?

I have an image that is linked that is contained by a div. I want to be able to **drag the linked image** to a tinyMCE control without its surrounding DIV. HTML:
For whatever reason it's dragging the DIV along with the IMG and A. Is there a way to get it to not drag the DIV. I've tried preventing default ondrag, onmousedown etc. on the DIV, but then nothing drags. I've tried: $(document).ready(function(){ $('#image_preview').on('mousedown', function(){ return false; }); }); and: $(document).ready(function(){ $('#image_preview').on('dragstart', function(e){ e.preventDefault(); }); }); and a couple of other things, but of course I knew none of those would do anything other than prevent dragging of anything within the DIV.
Can we see the rest of your code? specially what jquery commands you wrote

以上就是How do you drag a link without its parent div attached?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准