jQuery单击时拖动错误,图像跳开 [英] jquery Drag error when clicked, image jumps away

查看:107
本文介绍了jQuery单击时拖动错误,图像跳开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用了Ajax弹出扩展器和背景图像.在弹出窗口中,我使用了jquery来拖动图像.第一次单击可拖动图像时,它会跳开.那之后一切正常吗?
我需要紧急解决方案,请给我
我希望您能提供任何帮助.

I have use Ajax popup extender, and background image on it. Over popup i used jquery to drag image. when the draggable image is clicked for the first time, it jumps away. Thenafter everything works fine?
I need urgent solution, plz
I would like any help you can provide.

推荐答案

您好,似乎您单击的可拖动图像没有收到正确的左/上限值,您可以设置可拖动的图像图像css位置的绝对值,当前鼠标的X,Y值到您的可拖动图像的左/上,请看下面的代码:

Hi, it seems the draggable image you are clicking is not receiving proper left/top values, You can set your dragglable image css position to ABSOLUTE and current mouse X,Y values to your Draggable image Left/Top, Have a look at below code:


(" span>).click(函数(e) {
(".draggableImage").click(function(e) {


( this ).css({position:' 绝对',left:e.pageX,top:e.pageY}); });
(this).css({position:'absolute',left:e.pageX,top:e.pageY}); });



如果仍然有问题,请提供您的编码方式.



If still any problem then please provide the way you have coded.


这篇关于jQuery单击时拖动错误,图像跳开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆