Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
页面转换后的JQuery移动冲突_Jquery_Html_Jquery Mobile - Fatal编程技术网

页面转换后的JQuery移动冲突

页面转换后的JQuery移动冲突,jquery,html,jquery-mobile,Jquery,Html,Jquery Mobile,我是这个社区的新成员,首先为我糟糕的英语感到抱歉,我来自委内瑞拉,我的问题如下。我正在开发一个带有标题菜单动画的jquery移动应用程序,该程序是一个单页HTML文档,包含许多“页面”容器,在第一次加载时可以正常工作,但当使用$.mobile.changePage()更改页面时,菜单工作错误 标题为html <div data-role="header" data-position="fixed" style="text-align:center;"> <div id="

我是这个社区的新成员,首先为我糟糕的英语感到抱歉,我来自委内瑞拉,我的问题如下。我正在开发一个带有标题菜单动画的jquery移动应用程序,该程序是一个单页HTML文档,包含许多“页面”容器,在第一次加载时可以正常工作,但当使用$.mobile.changePage()更改页面时,菜单工作错误

标题为html

<div data-role="header" data-position="fixed" style="text-align:center;">
   <div id="navigation">
      <div class="home" style="height:100%">
         <div class="cls" style="height:100%;"></div>
         <div class="cls2" style="height:100%;"></div>
         <div class="cls3" style="height:100%;"></div>
         <div class="cls4" style="height:100%;"></div>
         <div class="cnf" style="height:100%;"></div>
      </div>
   </div>
    <h1 id="title" style="padding:4px;"></h1>

   <div id="navigation2">
      <div class="home2" style="height:100%">
         <div class="home2" style="height:100%">
            <div class="img" style="height:95%;"></div>
            <div class="cls" style="height:95%;"></div>
            <div class="cls2" style="height:95%;"></div>
            <div class="cls3" style="height:95%;"></div>
            <div class="cls4" style="height:90%;"></div>
         </div>
      </div>
   </div>
</div>

使用$.mobile.changePage()时,请理解您实际上并没有“更改”到该页面,也没有处理head标记中的任何脚本。在JQM中,当您使用changePage()时,JQM将从指定文件的第一个data role=“page”开始获取所有HTML(绕过head部分)

这里的链接非常好:

希望有帮助


~Red

使用$.mobile.changePage()时,请了解您实际上并没有“更改”到该页面,也没有处理head标记中的任何脚本。在JQM中,当您使用changePage()时,JQM将从指定文件的第一个data role=“page”开始获取所有HTML(绕过head部分)

这里的链接非常好:

希望有帮助

~Red

 $('div.cnf').bind('click',function(e) {
    e.preventDefault();
    if (click === null) {          
        $('div.home').stop(true, true).animate({
            'marginLeft' : '+=80%'
        }, 1000);
        click = 1;

    }else{            
        $('div.home').stop(true, true).animate({
            'marginLeft' : '-=80%'
        }, 1000);
        resetmenu();
    }

});

$('div.home2').toggle(function(e) {
    e.preventDefault();
    $(this).stop(true, true).animate({
        'marginLeft' : '-=80%'
    }, 1000);

}, function() {       
    $(this).stop(true, true).animate({
       'marginLeft' : '+=80%' 
    }, 1000);

});