jquery 鼠標(biāo)滑動顯示詳情應(yīng)用示例
更新時間:2014年01月24日 15:35:05 作者:
本文示例要為大家實現(xiàn)的效果是鼠標(biāo)滑動,顯示詳情,代碼很簡潔,很適合學(xué)習(xí)
效果如下圖:
實現(xiàn)的代碼很少,很簡潔,可參考學(xué)習(xí)
<script type="text/javascript">
jQuery(document).ready(function () {
ShowImage1();
});
var ShowImage1 = function () {
$(".show_box1 .show_box_dd").hover(function (e) {
$(".show_box1 .phover").hide();
$(".show_box1 .show_box_dd").show();
$(this).hide();
$(this).siblings().show();
},
function () {
});
};
</script>
<pre code_snippet_id="169406" snippet_file_name="blog_20140124_1_9547095" name="code" class="javascript"><div style="border-left: none" class="module-box1 orangeback show_box1"></pre>
<pre></pre>
<pre code_snippet_id="169406" snippet_file_name="blog_20140124_2_3723790" name="code" class="html"> <dl>
<div class="module-tit">
<span class="store-name">好評度排名</span>
</div>
<div>
<dd style="padding: 15px 0 10px 15px" class="phover">
<em class="current">1</em><img class="jiupic" src="images/jiu.gif" width="100" height="100" />
<span class="pname"><a href="#" target="_blank">五糧液</a> </span><span class="pinpingzhe">品評評分:</span><span class="fenshu">8.6分</span>
<div class="jindu"><span class="jindutiao"><em class="fen0"></em></span></div>
</dd>
<dd class="show_box_dd" style="display: none;">
<em>1</em><a href="#" target="_blank">五糧液</a><span class="rank">9分</span>
</dd>
</div>
<div>
<dd style="padding: 15px 0 10px 15px; display: none;" class="phover">
<em class="current">2</em><img class="jiupic" src="images/jiu.gif" width="100" height="100" />
<span class="pname"><a href="#" target="_blank">瀘州老窖</a> </span><span class="pinpingzhe">品評評分:</span><span class="fenshu">8.6分</span>
<div class="jindu"><span class="jindutiao"><em class="fen0"></em></span></div>
</dd>
<dd class="show_box_dd">
<em>2</em><a href="#" target="_blank">瀘州老窖</a><span class="rank">9分</span>
</dd>
</div>
<div>
<dd style="padding: 15px 0 10px 15px; display: none;" class="phover">
<em class="current">3</em><img class="jiupic" src="images/jiu.gif" width="100" height="100" />
<span class="pname"><a href="#" target="_blank">金六福</a> </span><span class="pinpingzhe">品評評分:</span><span class="fenshu">8.6分</span>
<div class="jindu"><span class="jindutiao"><em class="fen0"></em></span></div>
</dd>
<dd class="show_box_dd">
<em>3</em><a href="#" target="_blank">金六福</a><span class="rank">9分</span>
</dd>
</div>
</dl>
</div></pre>
<pre></pre>

實現(xiàn)的代碼很少,很簡潔,可參考學(xué)習(xí)
復(fù)制代碼 代碼如下:
<script type="text/javascript">
jQuery(document).ready(function () {
ShowImage1();
});
var ShowImage1 = function () {
$(".show_box1 .show_box_dd").hover(function (e) {
$(".show_box1 .phover").hide();
$(".show_box1 .show_box_dd").show();
$(this).hide();
$(this).siblings().show();
},
function () {
});
};
</script>
復(fù)制代碼 代碼如下:
<pre code_snippet_id="169406" snippet_file_name="blog_20140124_1_9547095" name="code" class="javascript"><div style="border-left: none" class="module-box1 orangeback show_box1"></pre>
<pre></pre>
<pre code_snippet_id="169406" snippet_file_name="blog_20140124_2_3723790" name="code" class="html"> <dl>
<div class="module-tit">
<span class="store-name">好評度排名</span>
</div>
<div>
<dd style="padding: 15px 0 10px 15px" class="phover">
<em class="current">1</em><img class="jiupic" src="images/jiu.gif" width="100" height="100" />
<span class="pname"><a href="#" target="_blank">五糧液</a> </span><span class="pinpingzhe">品評評分:</span><span class="fenshu">8.6分</span>
<div class="jindu"><span class="jindutiao"><em class="fen0"></em></span></div>
</dd>
<dd class="show_box_dd" style="display: none;">
<em>1</em><a href="#" target="_blank">五糧液</a><span class="rank">9分</span>
</dd>
</div>
<div>
<dd style="padding: 15px 0 10px 15px; display: none;" class="phover">
<em class="current">2</em><img class="jiupic" src="images/jiu.gif" width="100" height="100" />
<span class="pname"><a href="#" target="_blank">瀘州老窖</a> </span><span class="pinpingzhe">品評評分:</span><span class="fenshu">8.6分</span>
<div class="jindu"><span class="jindutiao"><em class="fen0"></em></span></div>
</dd>
<dd class="show_box_dd">
<em>2</em><a href="#" target="_blank">瀘州老窖</a><span class="rank">9分</span>
</dd>
</div>
<div>
<dd style="padding: 15px 0 10px 15px; display: none;" class="phover">
<em class="current">3</em><img class="jiupic" src="images/jiu.gif" width="100" height="100" />
<span class="pname"><a href="#" target="_blank">金六福</a> </span><span class="pinpingzhe">品評評分:</span><span class="fenshu">8.6分</span>
<div class="jindu"><span class="jindutiao"><em class="fen0"></em></span></div>
</dd>
<dd class="show_box_dd">
<em>3</em><a href="#" target="_blank">金六福</a><span class="rank">9分</span>
</dd>
</div>
</dl>
</div></pre>
<pre></pre>
相關(guān)文章
jquery easyui dataGrid動態(tài)改變排序字段名的方法
jQuery easyui dataGrid 動態(tài)改變排序字段名,一般情況下,在使用的時候,我們會點擊相應(yīng)字段進行排序。今天小編以java為例給大家講解問題原因及解決方案,需要的的朋友參考下2017-03-03jQuery ajax調(diào)用webservice注意事項
這篇文章主要為大家詳細介紹了jQuery ajax調(diào)用webservice的注意事項,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-10-10jQuery插件學(xué)習(xí)教程之SlidesJs輪播+Validation驗證
這篇文章主要介紹了jQuery插件學(xué)習(xí)教程之SlidesJs輪播+Validation驗證的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下2016-07-07jQuery控制DIV層實現(xiàn)由大到小,由遠及近動畫變化效果
這篇文章主要介紹了jQuery控制DIV層實現(xiàn)由大到小,由遠及近動畫變化效果,涉及jQuery基于animate方法操作頁面元素實現(xiàn)動畫漸變效果的相關(guān)技巧,需要的朋友可以參考下2015-10-10jQuery-serialize()輸出序列化form表單值的方法
jQuery-serialize()輸出序列化表單值在工作中很常見也很實用,于是本人搜集整理了一些,需要了解的朋友可以詳細參考下2012-12-12Easyui Treegrid改變默認圖標(biāo)的方法
這篇文章主要介紹了Easyui Treegrid改變默認圖標(biāo)的方法的相關(guān)資料,需要的朋友可以參考下2016-04-04