无法加载 Jquery 或 JQuerry.tabify
我需要在 Drupal 网站上创建一个选项卡式菜单。 drupal 安装是一个很好的 Drupal 4.7。为了创建选项卡式菜单,我使用 Jquery 的 tabify 插件。问题是我无法让它工作。看来 Jquery 没有加载。我将代码(如下)放在我想要提供菜单的网站上。它不起作用。然后我把它放在 drupal 主页面和每个模板文件上。也不工作。其原因何在?任何建议表示赞赏。这是我的代码:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.tabify-1.4.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
$('#tabbed_menu').tabify();
});
// ]]>
</script>
<ul id="tabbed_menu">
<li class="active"><a href="#description">Treatment</a></li>
<li><a href="#usage">Prices</a></li>
<li><a href="#download">FAQ</a></li>
</ul>
<div id="description" class="content">
some text
</div>
<div id="usage" class="content">
<h2>Prices</h2>
some text
</div>
<div id="download" class="content">
some text
</div>
和CSS:
#tabbed_menu{ padding: 0;}#tabbed_menu LI{ display: inline;}#tabbed_menu LI A{ background: #EDF; padding: 10px; float: left; border-right: 1px solid #CCF; border-bottom: none; text-decoration: none; color: #000; font-weight: bold;}#tabbed_menu LI.active A{ background: #E07; color: #FFFFFF;}.content_tabbed{ float: left; clear: both; border: 1px solid #CCF; border-top: 1px solid #CCF; border-left: 1px solid #CCF; background: #FFF; padding: 10px 20px 20px; width: 100%; border-bottom: 1px solid #CCF;}
I need to create a tabbed menu on a Drupal website. The drupal installation is a good ould Drupal 4.7. In order to create tabbed menu I use tabify plugin for Jquery. The problem is that I cannot get it working. It seems that the Jquery doesn't load. I put the code (below) on the website where I would like to have the menu. It didnt work. Then I put it on the main drupal page and on every template file. Not working either. What is the cause of that? Any advice appreciated. Here is my code:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.tabify-1.4.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
$('#tabbed_menu').tabify();
});
// ]]>
</script>
<ul id="tabbed_menu">
<li class="active"><a href="#description">Treatment</a></li>
<li><a href="#usage">Prices</a></li>
<li><a href="#download">FAQ</a></li>
</ul>
<div id="description" class="content">
some text
</div>
<div id="usage" class="content">
<h2>Prices</h2>
some text
</div>
<div id="download" class="content">
some text
</div>
And CSS:
#tabbed_menu{ padding: 0;}#tabbed_menu LI{ display: inline;}#tabbed_menu LI A{ background: #EDF; padding: 10px; float: left; border-right: 1px solid #CCF; border-bottom: none; text-decoration: none; color: #000; font-weight: bold;}#tabbed_menu LI.active A{ background: #E07; color: #FFFFFF;}.content_tabbed{ float: left; clear: both; border: 1px solid #CCF; border-top: 1px solid #CCF; border-left: 1px solid #CCF; background: #FFF; padding: 10px 20px 20px; width: 100%; border-bottom: 1px solid #CCF;}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为你加载的 jquery 是核心 jquery,你需要 jquery ui :) 并确保
位于你调用 tabify 的其他代码之上,:)
its because the jquery u have loaded on is the core jquery, u need the jquery ui :) and make sure that
<script>
is above other codes where you call the tabify, :)