How to set the jquery draggable with margin left?


Tags: javascript,jquery,html,css,jquery-ui

Problem :

On body load scale_roll div normally drag the full area of the main_scale div in x-axis. Then while clicking click function, the scale_roll div shall be move by margin-left css style. Then drag the scale_roll, only drag the balance div tag, not able to drag full div tag (before 100px). The margin-left property makes the problem in drag? How to drag the divtag in full area with marginleft? JSfiddle



Solution :

Change the marginLeft to left css

JS:

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

RESULT


    CSS Howto..

    How not to use body style css rule in part of html code?

    How to adjust responsive behaviour of menu bar's elements

    Using jQuery toggle to show content, but prevent closing when the user clicks on an input element

    How to style nested element that is styled by its parent already

    How can I improve this markup and CSS to keep things simple and easy to work with?

    How to apply css style when using ng-print inAngular JS

    How do i get css3pie to work on all Joomla 2.5 pages not just default page

    Background Image in WebView showing in Simulator, but not on Device

    How to trigger hasLayout on this li for IE 7 white space bug

    How do check the Css properties for an element when pressed in Google Chrome Developer Tools

    how to use text-indent only with element not ont it's :before Selector?

    2 Sidebar Columns Layout (How)?

    how to achieve facebook mobile site buttons menu scroll effect?

    hide/show html div with javascript

    How to reset jQuery toggled classes applied throughout the page? (AngularProject)

    Have there been measurements on how much faster CSS is than Javascript for coding an effect? [closed]

    How to make a Xul button bigger using css as it get focus?

    Show a box with text when hovering an image

    How to make rollover images in CSS using multiple image backgrounds and :hover pseudo

    How to change css class for multiple DOM elements with jQuery? [closed]

    How to move the text a bit up and to the right?

    how to make two functionality in one button.CSS BOOTSTRAP

    How can I set css for a class in a class?

    CSS - how do I float another div over another without overlapping

    How to change the css color code permanent using php

    How should I crop the image at client side using jcrop and upload it?

    How do I set dynamic width to a block element?

    How to position two
  • 's within a nested
      ?
  • How to add padding to the cells of a table with CSS [closed]

    How To Set Height of Child Div According To Parent Div