2
得到这个代码,这是我从一本书(新手忍者)稍微适应。jQuery的HREF左击不工作
用户点击“联系人”和形式的电话号码和HREF链接下方打开。链接左击什么都不做,但我可以用鼠标右键“在新标签中打开”点击,然后它的工作。
js和jQuery相当新颖,但我认为这个问题(也许我错了)是不能正常工作的href链接与打开窗体的'Contact'链接相同的'a',但是我不知道如何改变这一点。
<div id="contact">
<a href="#">Contact</a>
<form action="">
Phone me on:018<br><br>Email me at <a href="http://www.guardian.co.uk/lifeandstyle/2012/apr/04/samantha-brick-hated-good-looks?newsfeed=true">click me</a>
</form>
</div>
jQuery的
$('#contact form').hide();
$('#contact a').toggle(function() {
$(this)
.addClass('active')
.next('form')
.animate({'height':'show'}, {
duration:'slow',
easing: 'swing'
});
}, function() {
$(this)
.removeClass('active')
.next('form')
.slideUp();
});
非常感谢
就像一个魅力。谢谢。 – 2012-04-05 13:01:23