大佬教程收集整理的这篇文章主要介绍了如何使用JQuery选择整个>标签并使其成为链接?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<h3>Regional news</h3> <ul> <li class="alt clickable"> <h4><a href="/dave.htm">Fusce porta varius eros</a></h4> <h5>22 Feb 2009</h5> <p>Donec bibendum,mauris at vulputate vestibulum,nulla odio eleifend sem,in adipiscing orci neque sit amet ipsum.</p> </li> <li class="clickable"> <h4><a href="/dave.htm">Praesent turpis tellus,sagittis eu,molestie ac,posuere id,quam</a></h4> <h5>18 Feb 2009</h5> <p>Aliquam mollis. Aliquam erat volutpat. Nulla ultricies ullamcorper magna. Lorem ipsum dolor sit amet,consectetur adipiscing elit. Pellentesque hendrerit rhoncus dui.</p> </li> <li class="alt clickable"> <h4><a href="/dave.htm">Vivamus libero est,pulvinar vitae,dignissim ut,mollis non,tellus</a></h4> <h5>24 Feb 2009</h5> <p>Morbi quis felis. Nunc hendrerit nibh porttitor Leo. Aenean ut ipsum sit amet est feugiat bibendum. Vivamus adipiscing purus sed ipsum.</p> </li> </ul> <p class="moreregionalnews"><a href="#">View more regional news</a></p>
所以基本上当用户将鼠标悬停在整个面板上时,总体上存在翻转< li>不只是< h4> tag …但使用< h4>中包含的网址标记为链接…
我希望我理智地解释……我觉得我在那里迷茫:)
干杯
亚当
// when the page is loaded.. $(function() { // make the cursor over <li> element to be a pointer instead of default $('li.clickable').css('cursor','pointer') // iterate through all <li> elements with CSS class = "clickable" // and bind onclick event to each of them .click(function() { // when user clicks this <li> element,redirect it to the page // to where the fist child <a> element points window.LOCATIOn = $('a',this).attr('href'); return false; }); });
以上是大佬教程为你收集整理的如何使用JQuery选择整个>标签并使其成为链接?全部内容,希望文章能够帮你解决如何使用JQuery选择整个>标签并使其成为链接?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。