Posted By


cs2css3 on 05/13/10

Statistics


Viewed 429 times
Favorited by 0 user(s)

cs2css3's jroll


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(function(){
  2. $(".over img").mouseover(function(){
  3. $(this).attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"));
  4. }).mouseout(function(){
  5. $(this).attr("src",$(this).attr("src").replace(/^(.+)_o(\.[a-z]+)$/, "$1$2"));
  6. }).each(function(){
  7. $("<img>").attr("src",$(this).attr("src").replace(/^(.+)(\.[a-z]+)$/, "$1_o$2"))
  8. })
  9. })

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.