javascript - JQuery - .animate <img> -
morning mr. stackoverflow.
is possible .animate between 2 img ? like, change img src & fade new img src?
html
<img class="classimg" src="images/example.png" />
my pseudo jquery/javascript code:
on click animate .classimg height 50 width 100 opacity 1, 600 animate .classimg height 200 width 450, 400 animate .classimg change img src url(images/example_with_green.png), 700
thank affort - , 1st dec!
as robert said can this:
<script type="text/javascript"> $(function () { // find div.fade elements , hook hover event $('div.fade').hover(function() { // on hovering on find element want fade *up* var fade = $('> div', this); // if element being animated (to fadeout)... if (fade.is(':animated')) { // ...stop current animation, , fade 1 current position fade.stop().fadeto(1000, 1); } else { fade.fadein(1000); } }, function () { var fade = $('> div', this); if (fade.is(':animated')) { fade.stop().fadeto(1000, 0); } else { fade.fadeout(1000); } }); }); </script>
and html:
<div class="fade"> <img src="logo.png" alt="who are" /> <div> <img src="logoalt.png" alt="who are" /> </div> </div>
Comments
Post a Comment