开发者

Jquery tools tabs

开发者 https://www.devze.com 2023-03-28 13:35 出处:网络
I have setup some tabs using jquery tools and the history plugin. When i go to http://jimeagle.com/new/index.php#music.php the music page is correctly loaded but the home tab at the top is still high

I have setup some tabs using jquery tools and the history plugin.

When i go to http://jimeagle.com/new/index.php#music.php the music page is correctly loaded but the home tab at the top is still highlighted, how can i update the css of the tab when the tabs script changes the page?

I am also looking for som开发者_运维知识库e sort of callback when the ajax page has finished loading, so i can display a loading gif when you click a tab and hide it when the page has loaded.

Thanks.


The .load() method has the possibility to use a callback function. See the Manual.

$loader = $('.ajax-loading');
$('.tab').click(function() {
    $(this).append($loader); //Make spinner appear on click.
    $('#main-content').load('pages.php', function(data) { //Will fire on success
        $('#main-content').append(data);
        $loader.remove();
    });
});
0

精彩评论

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

关注公众号