简体   繁体   English

如何设置jquery可拖动与左边距?

[英]How to set the jquery draggable with margin left?

On body load scale_roll div normally drag the full area of the main_scale div in x-axis. 通常在车身负载上scale_roll div main_scale x轴拖动scale_roll div的整个区域。 Then while clicking click function, the scale_roll div shall be move by margin-left css style. 然后,在单击click函数时, scale_roll div将以margin-left css样式移动。 Then drag the scale_roll , only drag the balance div tag, not able to drag full div tag (before 100px). 然后拖动scale_roll ,仅拖动balance div标签,而不能拖动完整的div标签(100px之前)。 The margin-left property makes the problem in drag? margin-left属性使拖动出现问题? How to drag the divtag in full area with marginleft? 如何用marginleft在整个区域拖动divtag? JSfiddle JS小提琴

Change the marginLeft to left css marginLeft更改为left CSS

JS: JS:

$('#click').click(function(){
    $(".scale_roll").css("left",'100px');
});

RESULT 结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM