我是Django的新手,我正在使用JQuery的网页上工作。我试图让一个标题使用切换功能来显示更多信息,但是当我加载页面时,<h3>
标记会添加一个style =“display:none”并且标题会消失。我已将静态文件夹和所有必需的文件添加到该文件夹并检查我的settings.py以确保在STATIC_URL和STATICFILES_DIR中正确输入所有内容。
我在网页上的jquery代码:
<script type="text/javascript" src="{{ STATIC_URL }}jquery-1.10.1.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}bootstrap/js/bootstrap.js"></script>
<script>
$(document).ready(function(){
$('.swarmdetails').hide();
$('.span4 h3').toggle(
function(){
$(this).next('.swarmdetails').fadeIn(0);
$(this).addClass('close');
},//end of fadeIn
function(){
$(this).next('.swarmdetails').fadeOut(0);
$(this).removeClass('close');
}//end of fadeOut
);//end of toggle
$('.span4 li').mouseover(function(){
$(this).popover('show');
}).mouseout(function(){
$(this).popover('hide');
});
$('.dropdown-toggle').dropdown();
});
</script>
我试图切换的HTML:
<div class="span9">
<div class="row-fluid">
<div class="span4">
<h3 style="cursor: help">Resource Utilization</h3>
<p class="swarmdetails">Here you can view every resource under your management.
Filters include Project Name, Employee Name, etc </p>
</div>
<div class="span4">
<h3 style="cursor: help">Direct Reports</h3>
<p class="swarmdetails">Here you can view all managers
and filter by name. You can use this option to quickly change an resource's
manager and also see who each manager has reporting to them.</p>
</div>
</div>
</div>
有人可以帮我弄清楚我做错了什么,这样才能让这个有用吗?
答案 0 :(得分:1)
认为您正在使用jQuery&gt; = 1.8,方法签名.toggle(handler, handler)
已被删除(并且已从版本1.9中移除)。
可能吗?