Reputation: 5859
I just started learning JQuery.
My code:
$(document).ready( function(){
$('.img').click(function(){
$('.img').animate({
opacity: 0.25,
left: "+=50",
height: "toggle"
}, 5000, function(){
// Animation complete.
});
})
});
here .img is an image and I am doing an animation on that. But what I want is I don't want to specify each class type like .img
. All elements I have on the page(images, p,border) can go through the same animation. so I expect something like
$(this).click( function{ $(this).animate(.........
Is it possible by putting something like this
we don't have to specify the exact class? I tried with this, it is not working.
Upvotes: 0
Views: 29