Reputation: 353
I have a img. E.G.
I want some items fade out, fade in in loop on img. Is it possible jQuery?
Upvotes: 2
Views: 3615
Reputation: 1029
You should add additional images over the existing one an fade them in and out. The code would look something like this:
<img src='firstStar.jpg' alt='star image' id='firstStar' />
var loopImages = function(){
$('#firstStar').fadeIn(1500, function(){
$('#firstStar').fadeOut(1500, loopImages);
});
}
loopImages();
Other option might be placing transparent divs over the image and bluring them in a loop. For the later approach you can use blurjs library.
Upvotes: 3
Reputation: 15048
If you by "some items" refer to some items of the image itself - then the answer is no. But, if you have this image say as a background of some div then you could show some other elements on the image itself (by adding div
s or img
s and positioning them accordingly) which would then be fade-in fade-out by jQuery.
Upvotes: 0