Difference between revisions of "Team:OUC-China"
Line 1: | Line 1: | ||
− | + | ||
− | + | ||
− | + | ||
<meta charset="utf-8"> | <meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /> | <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /> | ||
Line 153: | Line 151: | ||
</style> | </style> | ||
− | + | ||
− | + | ||
<section class="section-wrap"> | <section class="section-wrap"> | ||
<div class="section section-1"> | <div class="section section-1"> | ||
Line 286: | Line 283: | ||
}); | }); | ||
</script> | </script> | ||
− | |||
− | |||
− |
Revision as of 09:07, 6 August 2015
<meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" /> <meta name="renderer" content="webkit"> <title>indexdemo</title>
<script type="text/javascript" src="js/jquery.min.js"></script> <script language="javascript" type="text/javascript">
var images_id= new Array("images/f1.jpg", "images/f2.jpg", "images/f3.jpg"); var index = 0; function switch_background(){ if(index ==images_id.length-1) { index = 0; }else{ index++; } document.getElementById("indexFlash").style.backgroundImage="url("+images_id[index]+")";
} window.onload = function() {
setInterval(switch_background, 1000);
} </script> <style>
body{ -webkit-text-size-adjust:none; margin:0px;} h1,h2,h3,h4,h5,h6{ font-size:62.5%; } body,button,input,select,textarea { font-family:Tahoma,Arial,Roboto,”Droid Sans”,”Helvetica Neue”,”Droid Sans Fallback”,”Heiti SC”,sans-self; font-size:62.5%; line-height:1.5; } ol,ul{ list-style:none; } html,body{
width:100%;
height:100%; overflow:hidden; }
.indexNavBox{ width:80%; height:110px; margin-left:10%; margin-top:-50px; border:#3fb8ab solid 1px; position:relative; color:#FFF;} .indexNavLogo{width:9%; height:45px; margin-left:10%; margin-top:28px ;background-image:url(images/OUC-China-logo.png); } .indexNavTxt{ font-size:1.1rem; width:64%; height:45px; right:6%;top:25px; position:absolute;} .indexNavBox a{ color:#FFF; text-decoration:none;} .indexNavBox a:hover{color:#f4dc76;}
- indexFlash{ width:50%; height:300px; margin-left:25%; margin-top:205px; position:absolute;}
.sectionTxtBox2{ width:70%; height:450px; border:#00C 2px solid; position:absolute; margin-left:15%; margin-top:60px;} .bg100{ background-size:100% 100%;} .sectionTittle{ width:70%; height:45px; font-size:1.8rem; position:relative; color:#FFF;} .sectionTxt2{width:70%; height:45px; font-size:1.1rem; position:absolute; margin-top:30px; padding-left:10px; color:#FFF;}
.sectionTxtBox3{ width:70%; height:450px; border:#00C 2px solid; position:absolute; margin-left:15%; top:60px; color:#FFF;} .sectionTxt3{width:70%; height:45px; font-size:1.1rem; position:absolute; margin-top:30px; padding-left:10px;}
.sectionTxtBox4{ width:70%; height:450px; border:#00C 2px solid; position:absolute; margin-left:15%; top:60px; color:#FFF;} .sectionTxt4{width:70%; height:45px; font-size:1.1rem; position:absolute; margin-top:30px; padding-left:10px;}
.sectionTxtBox5{ width:70%; height:450px; border:#00C 2px solid; position:absolute; margin-left:15%; top:60px; color:#FFF;} .sectionTxt5{width:70%; height:45px; font-size:1.1rem; position:absolute; margin-top:30px; padding-left:10px;} .bottom{ height:10%; width:45%; margin-left:30%;top:50px;background-image:url(images/OUC-China-sponsor.png); background-size:100% 100%; position:absolute;} .bottomTxt{ height:10%; width:30%; margin-left:40%;top:120px; position:absolute;} .bottomTxt i { font-size:14px; color:#3fb8ab; text-align:center; font-style:inherit;} .bottomFb{ height:34px; width:34px; position:absolute; top:115px; margin-left:60%; } .section-wrap{
width:100%;
height:100%; overflow:visible; transition:transform 1s cubic-bezier(0.05,0,0.005,1); -webkit-transition:-webkit-transform 1s cubic-bezier(0.86,0,0.03,1); } .section-wrap .section{
position:relative;
width:100%; height:100%; background-position:center center; background-repeat:no-repeat; } .section-wrap .section .title{ width:100%;position:absolute; top:10%;color:#CF0; font-size:2.4em; text-align:center; } .section-wrap .section .title p{
padding:0 4%;
opacity:0 } .section-wrap .section .title.active .tit{
opacity:1;
transform:translateY(-60px); -webkit-transform:translateY(-60px); transition:all 2s cubic-bezier(0.86,0,0.8,1); -webkit-transition:all 2s cubic-bezier(0.86,0,0.8,1); }
.section-wrap .section-1{ background-image:url(images/OUC-China-home1.jpg); background-size:100% 100%;} .section-wrap .section-2{ background-image:url(images/OUC-China-home2.jpg); background-size:100% 100%;} .section-wrap .section-3{ background-image:url(images/OUC-China-home3.jpg); background-size:100% 100%;} .section-wrap .section-4{ background-image:url(images/OUC-China-home4.jpg); background-size:100% 100%;} .section-wrap .section-5{ background-image:url(images/OUC-China-home5.jpg); background-size:100% 100%;} .section-wrap .section-6{ background-image:url(images/OUC-China-home6.jpg); background-size:100% 100%;} .put-section-0{
transform:translateY(0);
-webkit-transform:translateY(0); } .put-section-1{
transform:translateY(-100%);
-webkit-transform:translateY(-100%); } .put-section-2{
transform:translateY(-200%);
-webkit-transform:translateY(-200%); } .put-section-3{
transform:translateY(-300%);
-webkit-transform:translateY(-300%); } .put-section-4{
transform:translateY(-400%);
-webkit-transform:translateY(-400%); } .put-section-5{
transform:translateY(-430%);
-webkit-transform:translateY(-430%); }
.section-btn{
width:14px;
position:fixed; right:4%; top:60%;} .section-btn li{
width:20px;
height:20px; cursor:pointer; border-radius:50%; -webkit-border-radius:50%; margin-bottom:15px;
background-image:url(images/OUC-China-home-dot1.png);
} .section-btn li.on{ background-image:url(images/OUC-China-home-dot2.png);
border:none;
}
</style>
<section class="section-wrap">
</a>
<a href="#">home</a> | <a href="#">project</a> | <a href="#">measurement</a> | <a href="#">modeling</a> | <a href="#">human practice</a> | <a href="#">notebook</a> | <a href="#">team</a> |
</div>
</div>
mail to:oucigem@163.com
</div>
</section>
<script type="text/javascript" src="js/jquery.min.js"></script> <script type="text/javascript"> //Here reference: mouse wheel mousewheel plugin !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
$(function(){ var i=0; var $btn = $('.section-btn li'), $wrap = $('.section-wrap'), $arrow = $('.arrow');
/*Current page assignment*/ function up(){i++;if(i==$btn.length){i=0};} function down(){i--;if(i<0){i=$btn.length-1};}
/*Page slide*/ function run(){ $btn.eq(i).addClass('on').siblings().removeClass('on'); $wrap.attr("class","section-wrap").addClass(function() { return "put-section-"+i; }).find('.section').eq(i).find('.title').addClass('active'); };
/*Right button click*/ $btn.each(function(index) { $(this).click(function(){ i=index; run(); }) });
/*Click the page button*/ $arrow.one('click',go); function go(){ up();run(); setTimeout(function(){$arrow.one('click',go)},1000) };
/*Response mouse*/ $wrap.one('mousewheel',mouse_); function mouse_(event){ if(event.deltaY<0) {up()} else{down()} run(); setTimeout(function(){$wrap.one('mousewheel',mouse_)},1000) };
/*Response keyboard keys*/ $(document).one('keydown',k); function k(event){ var e=event||window.event; var key=e.keyCode||e.which||e.charCode; switch(key) { case 38: down();run(); break; case 40: up();run(); break; }; setTimeout(function(){$(document).one('keydown',k)},1000); } }); </script>