广

JavaScript

  • IOS开发
  • android开发
  • PHP编程
  • JavaScript
  • ASP.NET
  • ASP编程
  • JSP编程
  • Java编程
  • 易语言
  • Ruby编程
  • Perl编程
  • AJAX
  • 正则表达式
  • C语言
  • 编程开发

    ajax刷新-resize-change-delegate

    2018-04-06 10:41:28 次阅读 稿源:互联网
    零七广告
    $(function() {    var $div_li = $(".tab-menu li");    $div_li.click(function() {        $(this).addClass("selected").siblings().removeClass("selected");        var index = $div_li.index(this);        $(".tab-content > li").eq(index).show().siblings().hide();    }).hover(function() {        $(this).addClass("hover");    },    function() {        $(this).removeClass("hover");    }) $("#tab-base").prev(".beside-post-ad").remove();    $('.project-list tbody tr').hover(function() {        $(this).find('td').addClass('hover');    },    function() {        $(this).find('td').removeClass('hover');    });    $('.project-list tbody tr').click(function() {        $(this).find('td').css('background-color', '#F2F6FE');        var href = $(this).find('a').attr('href'); {            window.location = href;        }    });    $('#archives .mon').each(function() {        var num = $(this).next().children('li').size();        var text = $(this).text();        $(this).html(text + '<em> ( ' + num + ' 篇文章 )</em><span></span>');    });    $('#archives .mon').click(function() {        $(this).next().slideToggle(250,        function() {            $(this).prev().find('span').toggleClass('arrow-up');        });        return false;    });    $('#list-view').click(function() {        $('.card-view').removeClass('card-view').addClass('list-view');        $('#card-view').removeClass('active');        $(this).addClass('active');        return false;    });    $('#card-view').click(function() {        $('.list-view').removeClass('list-view').addClass('card-view');        $('#list-view').removeClass('active');        $(this).addClass('active');        return false;    });    $('#sidebr-view').toggle(function() {        $(this).removeClass("active");        $('.sidebar').hide();        $('.sidebar-content').css({            "float": "none",            "width": "auto"        });    },    function() {        $(this).addClass("active");        $('.sidebar').show();        $('.sidebar-content').css({            "float": "left",            "width": "680px"        });    });    $('.widget_categories ul li .children, .archives-cat li .children').parent().css('border-bottom', 'none');    $('.sidebar ul li a').not('.sidebar .widget_ads ul li a').each(function() {        var atext = $(this).html();        $(this).html('<i>#</i>' + atext);    });    $('.nav-drop span').click(function() {        $(this).toggleClass('active');        $('#nav').toggle(0);    });    $(window).bind("resize", resizeWindow);    function resizeWindow(e) {        var newWindowWidth = $(window).width();        if (newWindowWidth > 580) {            $('#nav').css('display', 'block');        } else {            $('#nav').css('display', 'none');        }    }    $('.index .default-thumb').parent().parent('.thumb-index').css({        'width': 'auto',        'margin-right': '0'    }) $('.entry-content p img').parent('p').css('text-indent', '0');    $('.entry-content p img').removeAttr('height');    $(".show-select").change(function() {        if ($(".show-select").attr("value") == '文章评论') {            $('#commentnavi, #commenttit').show();            $('#comments-list ol').fadeIn();            $('.pinglisth').fadeOut();            $('.tracktit').hide();        } else {            $('#comments-list ol').fadeOut();            $('#commentnavi, #commenttit').hide();            $('.pinglisth').fadeIn();            $('.tracktit').show();        }    })});$("#container").delegate("#nav-below a", "click",function() {    $(this).addClass("loading").text("loading...");    $.ajax({        type: "POST",        url: $(this).attr("href") + "#content",        success: function(data) {            result = $(data).find("#content .post-card");            nextHref = $(data).find("#nav-below a").attr("href");            $("#content").append(result.fadeIn(300));            $("#nav-below a").removeClass("loading").text("下一页 

    零七网部分新闻及文章转载自互联网,供读者交流和学习,若有涉及作者版权等问题请及时与我们联系,以便更正、删除或按规定办理。感谢所有提供资讯的网站,欢迎各类媒体与零七网进行文章共享合作。

    零七广告
    零七广告
    零七广告
    零七广告