本文介绍了Jpanel正在移动页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 你好 HTMLHelloHTML<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"><link rel="stylesheet" type="text/css" href="styles/styles.css"><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script><script src="jquery.jpanelmenu.min.js"></script></head><body>fa fa-list-ul fa-2x menu-trigger">Meny <ul id="menu" style="display: none;"> <li><a href="">1</a></li> <li><a href="">2</a></li> <li><a href="">3/a></li> <li><a href="">4</a></li> </ul><script type="text/javascript"> $(document).ready(function () { var jPM = $.jPanelMenu(); jPM.on(); });</script><div id="content"><section><article><form method="post" action="">var jPanelMenu = {};$(function() { $('pre').each(function(i, e) {hljs.highlightBlock(e)}); jPanelMenu = $.jPanelMenu({ menu: 'header.main nav', animated: false }); jPanelMenu.on(); $(document).on('click',jPanelMenu.menu + ' li a',function(e){ if ( jPanelMenu.isOpen() && $(e.target).attr('href').substring(0,1) == '#' ) { jPanelMenu.close(); } }); $(document).on('click','#trigger-off',function(e){ jPanelMenu.off(); $('html').css('padding-top','40px'); $('#trigger-on').remove(); $('body').append('<a href="" title="Re-Enable jPanelMenu" id="trigger-on">Re-Enable jPanelMenu</a>'); e.preventDefault(); }); $(document).on('click','#trigger-on',function(e){ jPanelMenu.on(); $('html').css('padding-top',0); $('#trigger-on').remove(); e.preventDefault(); });}); 问题是,当我打开Jpanel时,网站向右移动,当我关闭它时网站搬回来。我试图改变$('身体')的位置:绝对但是它仍然有效。 我的问题是,有谁知道我怎么做,所以整个网站不要只移动JpanelThe problem is when i open the Jpanel the site move to the right and when i close it the site move back. ihave tried to change in the $('body')position:absolute but it dident work.My question is do anyone know how i can do so the whole site dont move only the Jpanel推荐答案var jPanelMenu = {}; 这篇关于Jpanel正在移动页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-13 15:29