if you need unobstructive JavaScript for image rollover you can use following code. I am not providing any detail markups for that if you face some problem to use that let me know. i will provide a demo section very soon for all of script.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
jQuery.fn.extend({
 enter: function() {
    return this.each(function() {
      var pth = $(this).find("img")[0];
      if($(this).children().attr("href")==document.location.href){
         $(pth).attr("src",pth.src.replace(/.gif/g, '_over.gif'));
         } else{
            $(this).hover(function(){
              $(pth).attr("src",pth.src.replace(/.gif/g, '_over.gif'));
              },function(){
                 $(pth).attr("src",pth.src.replace(/_over.gif/g, '.gif'));
                 });
            }
            });
    }
});
$(function() { $("#nav li").enter();});

I have created this script for dot net development where navigation is in master page. So I have highlighed current page with if condition on line 5 on code ($(this).children().attr(“href”)==document.location.href). i have used gif images you can change code according to your image format.

%d bloggers like this: