目錄 購物車 {{currentCart.getItemCount()}}

橡皮擦球

/*============================================================================================================= __ _ _ / _|_ _ _ _ __| |_(_)___ _ _ | _| || | ' \/ _| _| / _ \ ' \ |_| \_,_|_||_\__|\__|_\___/_||_| */ var _multinum = 2.2; function _actionframe(st, percent, onbanner) { return; var gap = data_banner.length - 3; //if( st > $(window).height()*_multinum*gap ) { //if( percent > 90 ) { if(onbanner>=data_banner.length-1) { $('.header, .topbar').removeClass('close'); $('.btnscroll').addClass('close'); } else { $('.header, .topbar').addClass('close'); $('.btnscroll').removeClass('close'); } } function setbanner(obj, input) { // constructor var b = ''; for(var n=0; n'; if(input[n].background!=undefined) { b += ''; } else { b += ''; } if(input[n].img!='') { b += ' '; } if(input[n].img2!=undefined) { b += ' '; } if(input[n].video!=undefined) { b += ' '; b += ' '; b += ' '; } if(input[n].class!=undefined) { b += ''+input[n].text+''; } else { b += ''+input[n].text+''; } if(input[n].demotext!=undefined) { b += ''+input[n].demotext+''; } b += ''; b += ''; } obj.append(b); obj.append( obj.find('.item').first().clone() ); // setup var _scrollgap = $(window).height()*2.2; function _resize() { // for banner $('html,body').css({height:_scrollgap*(input.length-1)}); $(obj).find('.item').each(function() { //$(this).css({height:$(window).height()*.5, top:$(this).attr('data-top')}); $(this).css({height:0, top:$(window).height()}); $(this).find('img').css({width:$(window).width()*1.05, height:'auto'}); if($(this).find('img').height()<$(window).height()) { $(this).find('img').css({height:$(window).height(), width:'auto'}); } if($(this).index()==0) { $(this).css({height:$(window).height(), top:0}); } }); // cover // $('.cover img').css({width:$(window).width(), height:'auto'}); // if($('.cover img').height()<$(window).height()) { // $('.cover img').css({height:$(window).height(), width:'auto'}); // } } $(window).resize(_resize); setTimeout(function() {_resize();}, 300); _resize(); // event $(window).scroll(function() { // basic vars var st = $(document).scrollTop(); var percent = st / ( $(document).height()-$(window).height() )*100; var gap = 100 / input.length; var onbanner = parseInt(percent/gap)+1; var insidepercent = (percent/gap*100)%100; //console.log( percent, onbanner, insidepercent ) // overnumberset for(var n=0; n$(window).height()) h = $(window).height(); //console.log( tmpobj, h ) tmpobj.css({height:h, top:$(window).height()-h}); // return to first if(percent>98) { TweenMax.to($('html,body'), 0, {scrollTop:0}); } }); }/*============================================================================================================= _ _ _ (_)_ _ (_) |_ | | ' \| | _| |_|_||_|_|\__|*/ var data_banner = [ {img:'img/first.jpg', img2:'img/con-cover.svg', text:'', xtext:'你看過小混球橡皮擦嗎?', class:'dark'}, {img:'', video:'img/sample.mp4', text:'', demotext:'這裡放loop影片,球在各種場景中,約10個'}, {img:'', text:'不過就橡皮擦,誰在意?'}, {img:'img/txt.jpg', text:''}, {img:'', text:'Y世代橡皮擦, 多功能all-in-one', class:'full dark', background:'white'}, {img:'img/roman-bozhko-PypjzKTUqLo-unsplash.jpg', text:'這是橡皮擦'}, {img:'img/bg1.jpg', text:'這是球'}, {img:'img/DSC06566 copy.jpg', text:'插一支筆好好玩'}, {img:'img/bg2.jpg', text:'生氣的時候我捏暴他'}, {img:'img/DSC06597 copy.jpg', text:'還可以放名片'}, {img:'img/DSC06599 copy.jpg', text:'顏色隨心所欲紓壓好開心', class:'dark'}, {img:'img/bg5.jpg', text:'考試都考一百分呢!', class:'full'}, {img:'img/cover.jpg', text:'售價$360 買3送1', class:'dark', demotext:'製造,細節資料等等等'}, ]; $(document).ready(function() { // preset $('.loader .cover').hide(); TweenMax.to($('html,body'), .2, {scrollTop:0, ease:Back.easeInOut}); TweenMax.fromTo($('.loader .con'), .2, {scale:0.5}, {delay:.5, opacity:1, scale:.7, ease:Back.easeInOut}); $('.loader .con').find('path, ellipse').each(function() { var num = $(this).index(); if($(this).index()==0) num = 1; if($(this).index()==1) num = 2; if($(this).index()==2) num = 3; if($(this).index()==3) num = 0; var _d = num*.2 + .5; var _t = .3; TweenMax.fromTo($(this), _t, {opacity:0}, {opacity:1, delay:_d, ease:Expo.easeInOut}); }); TweenMax.fromTo($('.loader .con .logoobj'), .5, {opacity:0}, {opacity:1, delay:2, ease:Expo.easeInOut}); TweenMax.to($('.loader'), .7, { delay:1.8, top:-$(window).height(), ease:Expo.easeIn, onComplete:function() { $('.loader').remove(); } }); // init setbanner($('.bannerblock'), data_banner); });