Search code examples
javascriptjqueryshake

jquery shake doesn't work on divs


I was designing a webpage and needed JQuery shake to shake some divs but i couldn't get it to work so I guessed it maybe is something in my page which was preventing it. then I used it on two very simple divs but again it didn't work.
Fiddle.
Unfortunately I fail to notice what is wrong exactly.
thanks in advance.

$(document).ready(function() {
  $("div > div").on("click", function() {
    $("div > div").effect("shake", {
      times: 10
    }, 100);
  });
});

Solution

  • You need https://jqueryui.com/ for .effect function to be available.

    http://jsfiddle.net/1Lp7aoue/