From 65666a89bad5274c2c3872e5e0ab7d92692a341f Mon Sep 17 00:00:00 2001 From: idoctnef Date: Tue, 7 Jun 2016 19:07:50 +0200 Subject: [PATCH] imatges dinamiques a mitges --- index.html | 3 ++- index.js | 12 +++++++++++- own.css | 11 +++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 916797d..41d8c8c 100644 --- a/index.html +++ b/index.html @@ -22,7 +22,8 @@
- + +
CAT CAST diff --git a/index.js b/index.js index 3f5cd3d..65f8417 100644 --- a/index.js +++ b/index.js @@ -16,8 +16,18 @@ function OnLoadDefault(){ function OnLoadIndex(){ OnLoadDefault(); var numImg=0; + var visibleImg=0; setInterval(function(){ - document.getElementById("backgroundImage").src="imatges/background/background"+numImg+".jpg"; + + document.getElementById("backgroundImage"+visibleImg).className="own-indexBackgroundImage"; + if(visibleImg==0){ + visibleImg=1; + }else{ + visibleImg=0; + } + document.getElementById("backgroundImage"+visibleImg).className+=" own-opacity0"; + document.getElementById("backgroundImage"+visibleImg).src="imatges/background/background"+numImg+".jpg"; + numImg++; if(numImg>9) { diff --git a/own.css b/own.css index c7503c9..486649f 100644 --- a/own.css +++ b/own.css @@ -36,6 +36,10 @@ a:active { left: 0px; top: 0px; + -webkit-transition: opacity 1s ease-in-out; + -moz-transition: opacity 1s ease-in-out; + -o-transition: opacity 1s ease-in-out; + transition: opacity 1s ease-in-out; } } @@ -48,8 +52,15 @@ a:active { left: 0px; top: 0px; + -webkit-transition: opacity 1s ease-in-out; + -moz-transition: opacity 1s ease-in-out; + -o-transition: opacity 1s ease-in-out; + transition: opacity 1s ease-in-out; } } +.own-opactity0{ + opacity: 0; +} .own-langIndex{ text-align: right; margin-right: 50px;