
{"id":5372,"date":"2016-06-26T14:31:44","date_gmt":"2016-06-26T14:31:44","guid":{"rendered":"http:\/\/tapchicntt.com\/?p=5372"},"modified":"2023-08-28T16:49:15","modified_gmt":"2023-08-28T09:49:15","slug":"tao-slider-toan-man-hinh-cuc-ao-voi-tweenmax-va-css3","status":"publish","type":"post","link":"https:\/\/tapchicntt.com\/tao-slider-toan-man-hinh-cuc-ao-voi-tweenmax-va-css3\/","title":{"rendered":"T\u1ea1o Slider to\u00e0n m\u00e0n h\u00ecnh c\u1ef1c \u1ea3o v\u1edbi TweenMax v\u00e0 CSS3"},"content":{"rendered":"\n<p>Ch\u00e0o c\u00e1c b\u1ea1n, h\u00f4m nay m\u00ecnh s\u1ebd chia s\u1ebb cho c\u00e1c b\u1ea1n th\u00eam m\u1ed9t m\u1eabu slider full m\u00e0n h\u00ecnh v\u1edbi s\u1ef1 h\u1ed7 tr\u1ee3 c\u1ee7a TweenMax.min.js v\u00e0 CSS3.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">HTML<\/h2>\n\n\n\n<p>\u0110\u1ea7u ti\u00ean, c\u00e1c b\u1ea1n x\u00e2y d\u1ef1ng khung chu\u1ea9n html cho slider nh\u01b0 sau:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: xml; title: ; notranslate\" title=\"\">\n&lt;div class=&quot;box slide&quot;&gt;&lt;span&gt;What else you want ! ;)&lt;\/span&gt;&lt;\/div&gt;\n&lt;div class=&quot;box slide&quot;&gt;&lt;span&gt;Super Simple&lt;\/span&gt;&lt;\/div&gt;\n&lt;div class=&quot;box slide&quot;&gt;&lt;span&gt;Responsive&lt;\/span&gt;&lt;\/div&gt;\n&lt;div class=&quot;box slide&quot;&gt;&lt;span&gt;GSAP Timeline&lt;\/span&gt;&lt;\/div&gt;\n&lt;div class=&quot;box slide&quot;&gt;&lt;span&gt;Full Screen Slider (linear) #2&lt;\/span&gt;&lt;\/div&gt;\n \n&lt;div id=&quot;nav&quot;&gt;\n  &lt;div id=&quot;prevtBtn&quot; class=&#039;fa fa-chevron-circle-left&#039;&gt;&lt;\/div&gt;\n  &lt;div id=&quot;nextBtn&quot; class=&#039;fa fa-chevron-circle-right&#039;&gt;&lt;\/div&gt;\n&lt;\/div&gt;\n&lt;div id=&quot;Dots&quot;&gt;&lt;\/div&gt;\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">CSS<\/h2>\n\n\n\n<p>Sau \u0111\u00f3 d\u1ecbnh d\u1ea1ng slider v\u1edbi \u0111o\u1ea1n css b\u00ean d\u01b0\u1edbi.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: css; title: ; notranslate\" title=\"\">\nbody,html{  width: 100%;  height: 100%;}\nbody {\n  background-color: #222;\n  padding: 0px;\n  margin: 0px;\n  overflow: hidden;\n}\n\n#nav{ position: relative; z-index:5000; text-align: center; }\n\n#Dots{\n  position: absolute;\n  z-index:5000;\n  bottom:40px; left:50%;\n  transform:translate(-50%,0%);\n}\n\n.Dot{\n width:8px;\n height: 8px;\n border-radius: 50%;\n position: relative;\n float: left;\n background-color: #fff;\n opacity:1;\n margin:5px; margin-bottom:0px;\n cursor: pointer;\n border:2px solid rgba(255,255,255,0.7);\n}\n\n#prevtBtn,#nextBtn{\n  color: white;\n  font-size: 45px;\n  margin: 15px 15px 0px 15px;\n  position: relative;\n}\n\n.box {\n  width: 100%;\n  height: 100%;\n  position: absolute;\n  text-align: center;\n  font-size: 40px;\n  color: white;\n  font-family:'Oswald', arial;\n  top:0px;\n  left:0px;\n}\n.slide span{\n  display:block;\n  position:absolute;\n  -webkit-transform:translate(-50%,-50%);\n      -ms-transform:translate(-50%,-50%);\n          transform:translate(-50%,-50%);\n  left:50%; top:45%;\n}\n\n.box:nth-child(1) {\n  background-color: #ff002f;\n}\n.box:nth-child(2) {\n  background-color: #00718b;\n}\n.box:nth-child(3) {\n  background-color: #4a5619;\n}\n.box:nth-child(4) {\n  background-color: #ff002f;\n}\n.box:nth-child(5) {\n  background-color: #006f73;\n}\n\n#logo {\n  border-radius: 50%;\n  position:absolute;\n  z-index:5000;\n  top:20px; left:20px;\n}\n\n#links{z-index:500;position:absolute;bottom:0px;left:0px;width:100%;height:50px;font-size:14px;font-family:tahoma;color:#fff;}\n#links a{text-decoration:none;font-size:2.3em;color:#fff;}\n#twitter{position:absolute;bottom:15px;right:20px;}\n#pens{position:absolute;bottom:15px;left:20px;}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">Javascript<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\n\/* a Pen by DIACO : twitter.com\/Diaco_ml || codepen.io\/MAW\npowered by GSAP : http:\/\/www.greensock.com\/\n*\/\n \nvar slides=document.querySelectorAll(&#039;.slide&#039;),tl=new TimelineLite({paused:true});\nfor(var i=slides.length;i--;){\n    var D=document.createElement(&#039;div&#039;); D.className=&#039;Dot&#039;; D.id=&#039;Dot&#039;+i;\n    D.addEventListener(&#039;click&#039;,function(){ tl.seek(this.id).pause() });\n    document.getElementById(&#039;Dots&#039;).appendChild(D);\n    tl.add(&#039;Dot&#039;+i)\n    if( i &lt; 0 ){\n      if(i!=slides.length-1){tl.addPause()}\n        tl.to(slides&#x5B;i],0.5,{scale:.5,ease:Back.easeOut})\n        .to(slides&#x5B;i],0.7,{xPercent:-50},&#039;L&#039;+i)\n        .from(slides&#x5B;i-1],0.7,{xPercent:50},&#039;L&#039;+i)\n        .to(&#039;#Dot&#039;+i,0.7,{backgroundColor:&#039;rgba(255,255,255,0.2)&#039;},&#039;L&#039;+i)\n        .set(slides&#x5B;i],{zIndex:1-i}).set(slides&#x5B;i-1],{zIndex:slides.length})\n        .from(slides&#x5B;i-1],0.5,{scale:.5,ease:Back.easeIn})\n    };\n};\n\nfunction GO(e){\n  var SD=isNaN(e)?e.wheelDelta||-e.detail:e;\n  if(SD &gt; 0){tl.play()}else{tl.reverse()};\n};\n \ndocument.addEventListener(&quot;mousewheel&quot;,GO);\ndocument.addEventListener(&quot;DOMMouseScroll&quot;,GO);\ndocument.getElementById(&#039;nextBtn&#039;).addEventListener(&quot;click&quot;,function(){GO(-1)});\ndocument.getElementById(&#039;prevtBtn&#039;).addEventListener(&quot;click&quot;,function(){GO(1)});\n \n\/\/ a Pen by DIACO : twitter.com\/Diaco_ml || codepen.io\/MAW\n<\/pre><\/div>\n\n\n<p>Tr\u01b0\u1edbc khi ch\u00e8n \u0111o\u1ea1n script th\u00ec c\u00e1c b\u1ea1n nh\u1edb ch\u00e8n th\u01b0 vi\u1ec7n TweenMax.min.js v\u00e0o tr\u01b0\u1edbc, th\u01b0 vi\u1ec7n n\u00e0y c\u00e1c b\u1ea1n c\u00f3 th\u1ec3 t\u1ea3i v\u1ec1 t\u1ea1i m\u1ee5c donwload.<\/p>\n\n\n\n<p>Ch\u00fac c\u00e1c b\u1ea1n th\u00e0nh c\u00f4ng !<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ch\u00e0o c\u00e1c b\u1ea1n, h\u00f4m nay m\u00ecnh s\u1ebd chia s\u1ebb cho c\u00e1c b\u1ea1n th\u00eam m\u1ed9t m\u1eabu slider full m\u00e0n h\u00ecnh v\u1edbi [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":6864,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[145,142],"tags":[],"class_list":["post-5372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html-css","category-thu-thuat-jquery"],"views":477,"_links":{"self":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/comments?post=5372"}],"version-history":[{"count":16,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5372\/revisions"}],"predecessor-version":[{"id":8543,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/posts\/5372\/revisions\/8543"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media\/6864"}],"wp:attachment":[{"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/media?parent=5372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/categories?post=5372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tapchicntt.com\/rest-api\/wp\/v2\/tags?post=5372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}