开发者

After loading an animated gif, I want it to change to a jpg

开发者 https://www.devze.com 2023-04-11 07:08 出处:网络
I am using frames, and would like the page to load开发者_开发技巧 using animated gifs, but once loaded, I want the links to be jpegs with rollovers. Is it possible to have the final image a jpg loaded

I am using frames, and would like the page to load开发者_开发技巧 using animated gifs, but once loaded, I want the links to be jpegs with rollovers. Is it possible to have the final image a jpg loaded after the animated gif?


Uh, I don't really get what you're doing, but you change the src of an image in jquery like this:

$('.myimageselector').attr('src', 'mynewimage.jpg');


If you are saying you would like to convert a gif to a jpg on the client side, then no. You could always have something running server side sending them the files in the form of jpg (after being converted from gifs).


You can easily do this using the jQuery .hover function.

like this:

$('imageselector').hover(function(){
    $(this).attr('src','newimage.jpg');
},function(){
    $(this).attr('src','oldimage.gif');
});

Here is my example:

http://jsfiddle.net/MarkKramer/UEhFu/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号