$(function(){ var winW = $(window).width(); var winH = $(window).height(); var conW = $("footer").width()-90; var columns ={ setWidth : function(Object){ var W = 0, obj = $(Object); obj.each(function(){ var c_W = $(this).width()+1; c_W > W ? W = c_W : W; }) obj.width(W); }, tab1 : function(Object1,Object2){ var obj1 = $(Object1), obj2 = $(Object2), obj3 = obj2.children(); //obj2.height(obj3.eq(0).height()); obj1.on('click',function(){ var index = $(this).index(); //H = obj3.eq(index).height(); //obj2.height(H); obj3.eq(index).addClass('current').siblings().removeClass('current'); $(this).addClass('current').siblings().removeClass('current'); }); }, speakersInfo : function(){ winW = $(window).width(); var thisBoxW = $(".container").width(); if (winW > 768) { $(".speakers-bounced li").on("click", function (e) { var per_name = $(this).find("h5").text(); var per_title = $(this).find('.speakers2-text').find("p").text(); var per_introduction = $(this).find(".speakers-introduction").clone(); $("#speakers-info").find(".info-title").find("h4").text(per_name); $("#speakers-info").find(".info-title").find("p").text(per_title); $("#speakers-info").find("article").empty().append(per_introduction); var thisBoxH = $("#speakers-info").outerHeight(true) / -2; $("#speakers-info").css({width: thisBoxW, marginTop: thisBoxH, marginLeft: thisBoxW / -2}); $(".mask,#speakers-info").fadeIn(300); }) $(".mask,.close-btn").bind("click", function(){ $(".speakers-info,.mask").fadeOut(300); }); } }, registerBtn : function(){ var T; if ($('.register1').offset()) { setTimeout(function(){ T = $('.register1').offset().top-50; },1000); }; $('.banner-register').click(function () { var hf = $('.banner-register').attr('href'); if (hf == 'javascript:;') { $('html,body').animate({ 'scrollTop': T }); } }); }, successTipsClose : function(){ $('.success-tips-close-btn').on('click',function(){ $('.mask').fadeOut(); $('.success-tips').fadeOut(); }); }, mask :function(){ $('.mask').on('click',function(){ $('.mask').fadeOut(); $('.success-tips').fadeOut(); }); } } columns.speakersInfo(); columns.successTipsClose(); columns.mask(); $(document).ready(function () { columns.registerBtn(); columns.tab1('.agenda1-btn li','.agenda1-con'); }) $(window).resize(function(){ var windowW = $(window).width(); if (windowW != winW) { winW = $(window).width(); columns.speakersInfo(); columns.registerBtn(); columns.tab1('.agenda1-btn li','.agenda1-con'); }; }) })