首页 > 解决方案 > JQuery外部工具栏不显示

问题描述

想使用 JQuery 移动外部工具栏小部件。完全按照https://demos.jquerymobile.com/1.4.0/toolbar-external/中的描述进行操作,但标题不显示。相反,会引发“工具栏不是函数”错误。这是我的代码:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Test</title>
<link href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" rel="stylesheet" type="text/css">
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
<script>
$(function(){
    $( "[data-role='header'], [data-role='footer']" ).toolbar();
});
</script>
</head>

<body>
<div data-role="header" data-theme="a">
    <h1>Toolbar</h1>
  </div>    
<div data-role="page" id="page">
  
  <div data-role="content">Content</div>
</div>
    
</body>
</html>

使用本地 .js 源没有区别。

标签: jquery-mobiletoolbar

解决方案


推荐阅读