user3132101
user3132101

Reputation: 63

Jquery Draggable is not working in chrome and opera

I have used the jquery ui dragable on a image in my website, problem is that the functionality is working fine in Firefox but not in chrome and opera. In chrome and opera the dragable is working only for y axis and not for x axis. The console is totally clean and no error is coming. Here I'm providing my code :

$(".withroomimageupper").draggable({
        containment: ".pro_img_big",
        scroll: false,
        axis: "x,y"

});

Please help me....

Upvotes: 1

Views: 307

Answers (3)

Abhishek
Abhishek

Reputation: 357

Seems you are adding some lines of code which is not required. I found a Bin sample for you http://jsbin.com/ICEYaZor/2/edit

Upvotes: 0

Spyros
Spyros

Reputation: 313

Please read http://api.jqueryui.com/draggable/ Some of the options are not valid. "axis" option is not needed.

I believe this will work on all browsers:

$(".withroomimageupper").draggable({
        containment: ".pro_img_big",
        scroll: false
});

Upvotes: 0

Gabriele Petrioli
Gabriele Petrioli

Reputation: 196002

The axis is used to constrain the dragging in one of the horizontal or vertical axis.
(You can only restrict to one of them)

If you want it to be free just do not pass an axis.

$(".withroomimageupper").draggable({
        containment: ".pro_img_big",
        scroll: false
});

Upvotes: 1

Related Questions