javascript - Conditionally include script for browsers -
i have such kind of script code
settimeout(function () { $('.grayscale .inactive img').each(function () { $(this).wrap('<div style="display:inline-block;width:' + this.width + 'px;height:' + this.height + 'px;">').clone().addclass('gotcolors').css({ 'position': 'absolute', 'opacity': 0 }).insertbefore(this); this.src = grayscale(this.src); }).animate({opacity: 1}, 500); $(".grayscale li").hover(function () { $(this).find('.gotcolors').stop().animate({opacity: 1}, 200); }, function () { $(this).find('.gotcolors').stop().animate({opacity: 0}, 500); }); }, 1);`
and need in mozilla firefox, in chrome i'm having error grayscale(this.src)
. how can include script mozilla firefox?
you can achieve without use of library. here's how it:
if(navigator.useragent.tolowercase().indexof('firefox') > -1) { //your code }
Comments
Post a Comment