jQuery导致页面在IE7中中断,在所有其他浏览器中都可以正常运行

如何解决jQuery导致页面在IE7中中断,在所有其他浏览器中都可以正常运行

|| 我正在一个网站上,我们已经准备好上线了。直到我开始进行IE编辑。由于我的jQuery,该页面在IE7中已损坏。这是一个有多个插件的wordpress平台,但是我一次禁用了一个插件,但没有成功。我将jQuery置于无冲突模式,但仍然没有成功。任何帮助将非常感激。我在下面包含了我的jQuery,该网站的网址为http://prospermodels.com。如果您不介意帮助我,我可以为您提供管理员访问权限,等等。再次感谢。 / *下面的JQUERY代码
jQuery(document).ready(function() {
    jQuery(\".heat\").after(\"<div class=\'heatD\' style=\'display: none;\'>Heat Description which is available in the jQuery in the footer.</div>\");
    jQuery(\'.heat\').hover(function() {
        jQuery(\'.heatD\').show();
        jQuery(\".heatD\").css(\"margin-bottom\",300);
        },function() {
            jQuery(\'.heatD\').hide();
        });
    jQuery(\".cold\").after(\"<div class=\'coldD\' style=\'display: none;\'>Heat Description which is available in the jQuery in the footer.</div>\");
    jQuery(\'.cold\').hover(function() {
        jQuery(\'.coldD\').show();
        jQuery(\".coldD\").css(\"margin-bottom\",300);
    },function() {
        jQuery(\'.coldD\').hide();
    });
    jQuery(function(jQuery) {
        var slide = false;
        var height = jQuery(\'#wordd\').height();
        jQuery(\'#footer_button\').click(function() {
            var docHeight = jQuery(document).height();
            var windowHeight = jQuery(window).height();
            var scrollPos = docHeight - windowHeight + height;
            jQuery(\'#wordd\').animate({ height: \"toggle\"},400);
            if(slide == false) {
                if(jQuery.browser.opera) { //Fix opera double scroll bug by targeting only HTML.
                    jQuery(\'html\').animate({scrollTop: scrollPos+\'px\'},400);
                } else {
                    jQuery(\'html,body\').animate({scrollTop: scrollPos+\'px\'},400);
                }
                slide = true;
            } else {
                slide = false;
            }
        });

    });
    jQuery(function(){
        var footerHeight = jQuery(\"#foot\").height();
        var footerHeight2 = footerHeight + 40;
        var moree = footerHeight / 4;
        var mentrymore = footerHeight / 2;
        jQuery(\"#wrapper\").css(\"margin-bottom\",-moree);
    });
    jQuery(\"#right\").stickyfloat({lockBottom: false,startOffset: 180});
    var i = 0;
    jQuery(\'.alignleft\').each(function() {
        var me = this;
        jQuery(this).hide()
        var j = i;
        setTimeout(function() {
            jQuery(me).fadeIn(1000);
        },i)
        i += 100
    });
    if ((jQuery(\"#formBuilderContact\").css(\"display\")) == \"none\") {
        jQuery(\"#formBuilderContact\").css({display:\"none\"});
        jQuery(\"#formula1\").click(function() {
        jQuery(\"#formBuilderContact\").fadeIn();
        jQuery(\"#formula1\").css({display:\"none\"});
        });
    }
    (function(jQuery) {
        jQuery.fn.customFadeIn = function(speed,callback) {
            jQuery(this).fadeIn(speed,function() {
            if(jQuery.browser.msie)
                jQuery(this).get(0).style.removeAttribute(\'filter\');
            if(callback != undefined)
                callback();
            });
        };
        jQuery.fn.customFadeOut = function(speed,callback) {
            jQuery(this).fadeOut(speed,function() {
            if(jQuery.browser.msie)
                jQuery(this).get(0).style.removeAttribute(\'filter\');
            if(callback != undefined)
                callback();
            });
        };
    })(jQuery);
    if(!jQuery.browser.msie){ // IE  - 2nd level Fix
        jQuery(\"ul.topnav\").css({opacity:\"0.95\"});
    }
    jQuery(\".nav > li > ul\").css({display: \"none\"});
    jQuery(\".nav > li > ul > li > ul\").css({display: \"block\"});// Opera Fix
    jQuery(\"ul.nav li.current_page_ancestor ul.children\").css({display: \"block\"});
    jQuery(\"ul.children\").parent().append(\"<span></span>\"); //Only shows drop down trigger when js is enabled - Adds empty span tag after ul.subnav
    jQuery(\"ul.nav li a\").hover(function() { 
        var plug = jQuery(this).parent().find(\"ul.children\");
        plug.customFadeIn();
        jQuery(this).parent().hover(function() {

        },function(){
            jQuery(this).parent().find(\"ul.children\").customFadeOut(200); //When the mouse hovers out of the subnav,move it back up
        });
        //Following events are applied to the trigger (Hover events for the trigger)
        }).hover(function() {
            jQuery(this).addClass(\"subhover\"); //On hover over,add class \"subhover\"
        },function(){  //On Hover Out
            jQuery(this).removeClass(\"subhover\"); //On hover out,remove class \"subhover\"
    });
    if(!(jQuery.browser.msie)) {                        
        jQuery(\'div.grow\').divgrow({ initialHeight: 75,moreText: \"+ read more\",lessText: \"- show less\",showBrackets: false});
    }
    else {
        jQuery(\'div.grow\').divgrow({ initialHeight: 85,showBrackets: false});
    }
    if(!(jQuery.browser.msie)) {                        
        jQuery(\'div.grow2\').divgrow({ initialHeight: 83,showBrackets: false});
    }
    else {
        jQuery(\'div.grow2\').divgrow({ initialHeight: 88,showBrackets: false});
    }
    function slideSwitch() {
        var active = jQuery(\'#slideshow IMG.active\');
        if ( active.length == 0 ) active = jQuery(\'#slideshow IMG:last\');
        var next =  active.next().length ? active.next()
        : jQuery(\'#slideshow IMG:first\');
        active.addClass(\'last-active\');
        next.css({opacity: 0.0})
        .addClass(\'active\')
        .animate({opacity: 1.0},1000,function() {
            active.removeClass(\'active last-active\');
        });
        textSwitch();
    }
    var totPics = \"<?= $totPics ?>\";
    var activeDiv = 2;
    var text1 = \"<?= $text1 ?>\";
    var text2 = \"<?= $text2 ?>\";
    var text3 = \"<?= $text3 ?>\";
    var text4 = \"<?= $text4 ?>\";
    function textSwitch() {
        if (activeDiv <= totPics) {
            if (activeDiv == 1) {
                jQuery(\'#div<? echo $totPics ?>\').fadeOut(\'slow\',function() {
                jQuery(\'#div1\').css({display: \'inline-block\'})
                jQuery(\"#div1\").fadeIn(\"slow\");
            });
            activeDiv++;
            }
            else if (activeDiv == 2) {
                jQuery(\'#div1\').fadeOut(\'slow\',function() {
                    jQuery(\'#div2\').css({display: \'inline-block\'})
                    jQuery(\"#div2\").fadeIn(\"slow\");
                });
                activeDiv++;
            }
            else if (activeDiv == 3) {
                jQuery(\'#div2\').fadeOut(\'slow\',function() {
                    jQuery(\'#div3\').css({display: \'inline-block\'})
                    jQuery(\"#div3\").fadeIn(\"slow\");
                });
                activeDiv++;
            }
            else if (activeDiv == 4) {
                jQuery(\'#div3\').fadeOut(\'slow\',function() {
                    jQuery(\'#div4\').css({display: \'inline-block\'})
                    jQuery(\"#div4\").fadeIn(\"slow\");
                });
                activeDiv = 1;
            }
        }
        else {
            activeDiv = 1;
            textSwitch();
        }
    }
    jQuery(function() {
        if (totPics > 0) {    
            setInterval( \"slideSwitch()\",5000 );
        }
    });
    /*HOVER INTENT COPY AND PASTED */
    (function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind(\"mousemove\",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type==\"mouseover\"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type==\"mouseover\"){pX=ev.pageX;pY=ev.pageY;$(ob).bind(\"mousemove\",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,cfg.interval);}}else{$(ob).unbind(\"mousemove\",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);

});
    

解决方法

        我有一个网站,其中JQuery在IE7中无法正常工作。您的代码没有错,也没有任何办法可以纠正这一点,除非您要让其他人创建与您相同的代码,否则他们将以不同的方式来做。     

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-