【发布时间】:2011-03-06 00:59:02
【问题描述】:
如何将鼠标悬停在项目列表中的项目上,并且属于该特定项目的隐藏 div 将在鼠标悬停时显示并在鼠标悬停时消失?这个脚本目前的问题是只有第一项淡入淡出,但是当我将鼠标悬停在列表中的其他项目上时,第一项仍然是淡入淡出的唯一目标。请帮助提前谢谢..
我的脚本:
<script type="text/javascript">
$(document).ready(function(){
$(".title").hover(function(){
$("#projdesc").fadeIn();
}, function(){
$("#projdesc").fadeOut();
});
});
</script>
我的html:
{% for job in job_list %}
{% if job.is_active %}
<tr class="{% if forloop.counter|divisibleby:2 %}oddRow{% else %}evenRow{% endif %}">
<td width="40%">
<a href="{{ job.get_absolute_url }}">
<div class="title">
{{ job.title }}
</div>
</a>
<div id="projdesc" class="proj_desc">
{{ job.description|truncatewords:28 }}
</div>
<td width="11%" valign="top">
<div class="posted_by">
{{ job.job_creator.nickname }}
</div>
</td>
<td width="17%" valign="top">
<div class="proj_cat">
{{ job.skill.name }}
</div>
</td>
<td width="8%" valign="top">
<div class="weekly_rate">
{{ job.budget|floatformat:0 }}
</div>
<td width="10%" valign="top">
<div class="proj_pDate">
{{ job.created_at|date:"j/m/Y" }}
</div>
</td>
<td width="7%" valign="top">
<div class="proj_LDate">
{{ job.get_bid_time_left }}
</div>
</td>
<td width="7%" valign="top">
<div class="bids">
{{ job.get_no_of_bids }}
</div>
</td>
</td>
</div>
{% endif %}
{% endfor %}
</tr>
【问题讨论】:
标签: javascript jquery