0

how to keep same tab highlighting after refreshing the page(page is refreshed after the paging link clicked.)

    <script type="text/javascript">


        /**this is for tab highliting*/
        $(document).ready(function(){
            var str=location.href.toLowerCase();
            $(".navigation li a").each(function() {
                if (str.indexOf(this.href.toLowerCase()) > -1  ) {
                    $("li.highlight").removeClass("highlight");
                    $(this).parent().addClass("highlight");
                }
            });
        })


        /**this is for paging highliting*/
        $(document).ready(function(){
            var str=location.href.toLowerCase();
            $(".paging li a").each(function() {
                if (str.indexOf(this.href.toLowerCase()) > -1  ) {

                    $("li.highlight").removeClass("highlight");
                    // i need codes here to addclass "highlight" previously selected tab after page was refreshed


                    $("li.hp").removeClass("hp");
                    $(this).parent().addClass("hp");
                }
            });
        })




    </script>

thanks..!!

2
Contributors
1
Reply
7
Views
5 Years
Discussion Span
Last Post by LastMitch
0

how to keep same tab highlighting after refreshing the page(page is refreshed after the paging link clicked.)

You can take a look at these links and used a few line of code to add to your own code:

http://stackoverflow.com/questions/4299435/remember-which-tab-was-active-after-refresh

http://stackoverflow.com/questions/10246199/jquery-tabs-make-current-tab-highlighted-from-separate-navigation

http://stackoverflow.com/questions/6857654/jquery-mobile-highlight-a-tab

Edited by LastMitch: grammer

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.