page is scrolling down when i use next tab button in tab menu
<script type='text/javascript'>
$(window).load(function(){
$("#tabs").tabs();
$(".nexttab").click(function() {
$("#tabs").tabs("select", this.hash);
});
});
</script>
<tr>
<td> </td>
<td align="right"> <a class="nexttab" href="#tabs-1"> << Back </a> <a class="nexttab" href="#tabs-3">Next >> </a> </td>
</tr>
When i use above code i开发者_高级运维t is perfectly moving to next tab and previous tab. but problem is when i go to next or previous tab, my screen is going down ( i mean page is scrolling down little but). could you Please help me out.. Thanks in advance.
Regards Ramesh
The #tabs-1 and #tabs-3 in your anchor tags is making the browser to jump to these anchor points. To prevent this, add return false; to the end of your click handler, to prevent the default browser action.
You have to add a return false in your click handler, so it do not jump to the defined hash.
$(".nexttab").click(function() {
$("#tabs").tabs("select", this.hash);
return false;
});
Also using << Back or Next >> is not valid. Use << Back instead or even Next >>
加载中,请稍侯......
精彩评论