//滑动弹出效果 artdialog.slide = function (options) { var opt = options || {}, api, aconfig, hide, wrap, top, duration = 400,steep=50,easing='linear'; var config = { init: function(here){ api = this; aconfig = api.config; wrap = api.dom.wrap; top = parseint(wrap[0].style.top); hide = parseint(top + steep); wrap.css({'top': hide + 'px',opacity: 0}) .animate({top: top + 'px',opacity: 1}, duration,easing, function () { opt.init && opt.init.call(api, here); }); }, close: function(here){ wrap.animate({top: top-steep + 'px',opacity: 0}, duration,easing, function () { opt.close && opt.close.call(this, here); aconfig.close = $.noop; api.close(); wrap.css('top', hide + 'px'); }); return false; } }; for (var i in opt) { if (config[i] === undefined) config[i] = opt[i]; }; return artdialog(config); }; // $(function(){ // $('#nav a').hover(function(){ // $('#nav a').removeclass('selected'); // $(this).addclass('selected'); // }); $('.top').click(function(){ $('body,html').animate({scrolltop:0},1000); }); //banner效果 $('#kv').caroufredsel({ auto: { timeoutduration:8000 }, prev:"#kv_prev", next:'#kv_next', responsive: true, direction : "left", width: '100%', scroll: { fx:"crossfade", easing:'swing', duration:'500' }, pagination: { container:"#kv_page", anchorbuilder:function( nr ) { return ""; } } }); //作品滚动效果 $('#works_con').caroufredsel({ circular: false, infinite: false, auto: false, prev:"#works_prev", next:'#works_next', scroll:"easeinoutcirc", pagination: { container:"#works_page", anchorbuilder:function( nr ) { return ""; } } }); //新闻滚动效果 $('#news_con').caroufredsel({ circular: false, infinite: false, auto: false, prev:"#news_prev", next:'#news_next', scroll:"easeinoutcirc", pagination: { container:"#news_page", anchorbuilder:function( nr ) { return ""+nr+" "; } } }); //关于我们滚动效果 $('#about_con').caroufredsel({ responsive: true, circular: false, infinite: false, auto: false, scroll: { fx:"crossfade", easing:'swing', duration:'500' } }); $('#about_cat > a').bind('click',function(){ $index = $('#about_cat > a').index($(this)); $('#about_cat > a').removeclass('selected').eq($index).addclass('selected'); $("#about_con").trigger("slidetopage", $index); }); //关于我们滚动效果 $('#service_con').caroufredsel({ responsive: true, circular: false, infinite: false, auto: false, scroll: { fx:"crossfade", easing:'swing', duration:'500' } }); $('#service_cat > a').bind('click',function(){ $index = $('#service_cat > a').index($(this)); $('#service_cat > a').removeclass('selected').eq($index).addclass('selected'); $("#service_con").trigger("slidetopage", $index); }); }); function showwindow(id){ $('#newinfo').find('h4').html($(id).parent().find('h4').html()); $('#newinfo').find('p').html('post time'+$(id).attr('data')); $('#newinfo').find('.con').html($(id).parent().find('.data_con').html()); var news=art.dialog.slide({ fixed: false, drag: false, resize: false, follow: null, title: '', lock: true, padding:"0px 0px", content: $('#newinfo').get(0), init:function(){ $('.newinfo .close').click(function(){ news.close(); }); } }); } function showteam(id){ var team=art.dialog.slide({ fixed: false, drag: false, resize: false, follow: null, title: '', lock: true, padding:"0px 0px", content: $(id).parent().find('.data_con').find('.newinfo').get(0), init:function(){ $('.newinfo .close').click(function(){ team.close(); }); } }); }