Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/371.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
Javascript 打开页面上的侧面板onload_Javascript_Jquery_Panels - Fatal编程技术网

Javascript 打开页面上的侧面板onload

Javascript 打开页面上的侧面板onload,javascript,jquery,panels,Javascript,Jquery,Panels,我想在PageOnLoad上打开一个侧面板 使用的代码片段是 $(document).ready(function(event,ui) { $("#mypanel").panel("open",{display: 'overlay', position: 'left'}); }); 我不是jquery mobile的专家,但在本例中()面板在文档加载时打开 <!DOCTYPE HTML> <html> <head> <meta charset="

我想在PageOnLoad上打开一个侧面板

使用的代码片段是

$(document).ready(function(event,ui)
{
   $("#mypanel").panel("open",{display: 'overlay', position: 'left'});
});

我不是jquery mobile的专家,但在本例中()面板在文档加载时打开

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquerymobile/1.4.2/jquery.mobile.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#mypanel").panel("open");
})
</script>
</head>

<body>
<div data-role="page">          
    <div data-role="panel" id="mypanel" data-theme="a" class="ui-response">
        <p>This is my content</p>
    </div>
   <div data-role="content">
     <a href="#mypanel" data-role="button" data-display="overlay" data-position="left" data-dismissible="true">Panel open/close</a>
   </div>
</div>
</body>
</html>

$(文档).ready(函数(){
美元(“#我的面板”)。面板(“打开”);
})
这是我的内容


如果此解决方案不适合您的需要,我很抱歉让您耽误了时间。

请告诉我为什么不起作用??嘿,这里的一切似乎都很完美,我想在此快速询问一个问题,即在标记数据中不需要rel标记。?是的,请参见向页面正文添加大量文本,但当面板在左侧打开时,文本会显示在右侧,尽管提到class=“ui responsive”