/ Published in: jQuery
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$(function(){ $(".over img").mouseover(function(){ $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2")); }).mouseout(function(){ $(this).attr("src",$(this).attr("src").replace(/^(.+)_o(\.[a-z]+)$/, "$1$2")); }).each(function(){ $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2")) }) })