开发者

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>&nbsp;</td>
    <td align="right">  <a class="nexttab" href="#tabs-1">  << Back  </a> &nbsp;&nbsp; <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 &lt;&lt; Back instead or even Next &gt;&gt;

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜