if condition: if the browser is IE and IE browser version is older than 9

前端 未结 9 1143
时光说笑
时光说笑 2020-12-24 09:17

The if condition below I think it says - if the browser is IE and IE browser version is newer than 9, but I don\'t have IE 9 to test it so it is hard to know the correct out

9条回答
  •  感情败类
    2020-12-24 09:51

    I found cascading it works great for multibrowser detection. This code was used to change a fade to show/hide in ie 8 7 6.

    $(document).ready(function(){
        if(jQuery.browser.msie && jQuery.browser.version.substring(0, 1) == 8.0)
             { 
                 $(".glow").hide();
                $('#shop').hover(function() {
            $(".glow").show();
        }, function() {
            $(".glow").hide();
        });
             }
             else
             { if(jQuery.browser.msie && jQuery.browser.version.substring(0, 1) == 7.0)
             { 
                 $(".glow").hide();
                $('#shop').hover(function() {
            $(".glow").show();
        }, function() {
            $(".glow").hide();
        });
             }
             else
             {if(jQuery.browser.msie && jQuery.browser.version.substring(0, 1) == 6.0)
             { 
                 $(".glow").hide();
                $('#shop').hover(function() {
            $(".glow").show();
        }, function() {
            $(".glow").hide();
        });
             }
             else
             { $('#shop').hover(function() {
            $(".glow").stop(true).fadeTo("400ms", 1);
        }, function() {
            $(".glow").stop(true).fadeTo("400ms", 0.2);});
             }
             }
             }
           });
    

提交回复
热议问题