$(function() {
    //返回顶部
    $(".back2top").click(function() {
        $('body,html').animate({ scrollTop: 0 }, 500);
        return false;
    });
    $(".t-back2top").click(function() {
        $('body,html').animate({ scrollTop: 0 }, 500);
        return false;
    });
    //导航
    $(".meun-off").click(function() {
        //$(this).toggleClass("meun-on");
        $(".navt").slideDown(500);
    });

    $(".navt .close").click(function() {
        //$(this).toggleClass("meun-on");
        $(".navt").slideUp(500);
    });


    //
    $(".navt a").hover(function() {
        $(this).children(".en").css({ "margin-top": "-80px" });
    }, function() {
        $(this).children(".en").stop().css({ "margin-top": "0px" });
    });

    //
    $(".share").hover(function() {
        $(this).find(".share-list").addClass("active");
    }, function() {
        $(this).find(".share-list").removeClass("active");
    });

});

$(function(){
    $("#filters a").click(function(){
        $(this).addClass("active");
        $(this).siblings().removeClass("active");
    });
});

var worksthumbs = {
    init: function() {
        $container = $('.case-content');
        $container.isotope({
            itemSelector: '.item',
            masonry: {
                columnWidth: ".item"
            }

        });

        $container.find("img").each(function(index, element) {
            var imageUrl = $(this).attr("data-original");
            var img = new Image();
            img.src = imageUrl;
            img.onload = function() {
                $container.isotope('layout');
            }

        });

    }
}