user2037137 user2037137 - 6 months ago 27
Javascript Question

.animation is not a function

I'm using Drupal and jQuery says

.animation is not a function
. Why am I getting this error?

(function($){
var cg_parent = "#block-views-content_gallery-cg_block";
var cg_items = cg_parent + " ul";
var cg_item = cg_items + " li";

$(cg_item + ".views-row-first div.cg_item").addClass("active");
$(cg_item + ".views-row-first div.cg_item").bind("mouseenter", function() {
$("div.cg_item.active div.cg_body_content").animation({ left: '100px' }, 100, function() {
alert("je;;p");
});
});
})(jQuery);


http://jsfiddle.net/seejee/sYFR9/7/

Answer

The method is named animate not animation:

$("div.cg_item.active div.cg_body_content").animate({ left:'100px' }, 100, function() {  
    alert("je;;p");
});
Comments