Reputation: 557
Still trying to solve this after many hours. The script works in jfiddle: http://jsfiddle.net/uCcYw/3/ ,apply flash effect to parent of add_item (simplecart_shelfitem), but not online: http://www.diysoakwells.com.au/test.html. Its the same code copied and pasted, i dont get it !! PLease help : )
Upvotes: 1
Views: 245
Reputation: 218732
Change
(function() {
$(".item_add").click(function() {
$(this).parent().effect("highlight", {}, 750);
return false;
});
})(jQuery);
to
$(function() {
$(".item_add").click(function() {
$(this).parent().effect("highlight", {}, 750);
return false;
});
})
Working sample : http://jsfiddle.net/gtT4H/7/
Upvotes: 1
Reputation: 337560
Your ready handler is missing the $
from the start:
$(function() {
$(".item_add").click(function() {
$(this).parent().effect("highlight", {}, 750);
return false;
});
});
Upvotes: 0
Reputation: 6403
You haven't wrapped your JavaScript in a $(document).ready()
call. The element with the specified class doesn't exist at the point of JS execution.
Upvotes: 0
Reputation: 7140
You need to put it inside
$(document).ready(function() {
// some code here
});
Upvotes: 5