Wednesday 15 June 2011

onclick - Droppable vs Clickable in Jquery -


We are successfully using drag and drop functions through jQuery on some images. Below is how we have droppable.

  $ ('.t1 span.droppable') each (function () {$ ('. Droppable'). Droppable ({drop: function (event, UI) {// drop function Here we are.}   

We are now trying to image on the click, we did this before, it does not work at all. Click

Next we have tried It works but if it has 20 images, it alerts 20 times.

  $ ('.t1 span img.clickable') each (function () {$ (' Clickable). (Function () {warning ("test");})}}   

What is the best mechanism to solve this?

  $ ('t1 span img clash'). Each (function () {$ ('. Clickable). (Function () {warning ("test");}); return false;});   

Add a return false and fix it. / P>

No comments:

Post a Comment