Jayesh Patel
Filed under - JavaScript, jQuery
No Comments so far. Add yours now
Selec All Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
$(function () {
	$(".swapImage")
        .mouseover(function() { 
            var src = $(this).find("img").attr("src").match(/[^\.]+/) + "-o.png";
            $(this).find("img").attr("src", src);
        })
        .mouseout(function() {
            var src = $(this).find("img").attr("src").replace("-o.png", ".png");
            $(this).find("img").attr("src", src);
        });
 
    var imgSwap = [];
	$(imgSwap).preload(); 
})
$.fn.preload = function() {
    this.each(function(){
        $('

Selec All Code:
1
2
3
')[0].src = this;
    });
}

Leave your comment

You must be logged in to post a comment.

Share IT © 2018. All rights reserved.