jQuery UI tabs, update url when clicking on a different tab

前端 未结 8 789
甜味超标
甜味超标 2020-12-09 11:56

I\'m using the tabs of jQuery UI: http://jqueryui.com/demos/tabs/

How to update the current url of the browser when the user click on a different ta

8条回答
  •  天命终不由人
    2020-12-09 12:22

    $( "#tabs" ).tabs({            
            activate: function(event, ui) {
                //Key => random string
                //url => URL you want to set
                window.history.pushState({key:'url'},'','url');
            }
        });
    

提交回复
热议问题