href attribute in Jquery not being pulled correctly -
i using following code fade in clicked tab keeps fading in same tab regardless of list item click on:
$('#productinfowrap .tab:first').show(); $('#subselect li').click(function() { var thistop = $(this).position().top; $('#subselect li').removeclass('current'); var li = (this); $('.pointer').animate( {'top': thistop}, function() { $(li).addclass('current'); }); var id = $("#subselect li a").attr('href'); $("#productinfowrap > div").fadeout(500).hide(); $(id).fadein(); return false; });
and html
<ul id="subselect"> <li class=""><a href="#overview">overview</a><span class="pointer" style="top: 225px;"></span></li> <li class=""><a href="#applications">applications</a></li> <li class=""><a href="#technical">technical</a></li> </ul>
other correct tab fading in, works perfectly...
change line to:
var id = $(this).find("a").attr('href');
Comments
Post a Comment