I can't get the jQuery animate effect to work. What is strange is when I add in a .cli开发者_JS百科ck function it works fine.
Can anyone suggest a solution or work around to get this effect to run on the page load?
$(document).ready(function() {
var image2_template = $(".image2_template");
console.log(image2_template.length);
$(image2_template).effect( "pulsate",
{times:5}, 3000 );
});
The console returns a value of 1 so .image2_template is an object, I have no idea why the animation won't fire.
You're probably not including jQuery UI.
See http://jsfiddle.net/tusbar/Xgftz/ for a working demo.
精彩评论