Last active
September 3, 2020 16:55
-
-
Save dusk0r/3d5b46b3ed43aae88b2d to your computer and use it in GitHub Desktop.
Revisions
-
dusk0r revised this gist
Apr 22, 2015 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -55,11 +55,9 @@ <body> <div class="bgimage" id="bgimage1"> </div> <div class="bgimage" id="bgimage2"> </div> </body> </html> -
dusk0r revised this gist
Apr 22, 2015 . 1 changed file with 50 additions and 48 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,63 +1,65 @@ <html> <head> <style type="text/css"> .bgimage { position: fixed; background-repeat: no-repeat; background-position: center; background-size: cover; background-color: black; width: 100%; height: 100%; } #bgimage1 { /* Initiales Bild */ background-image: url(bg.1.jpg); } #bgimage2 { display: none; } </style> <script type="text/javascript"> function fadeImages() { var bgImages = ["bg.1.jpg", "bg.2.jpg", "bg.3.jpg", "bg.4.jpg"]; var layer1 = $("#bgimage1"); var layer2 = $("#bgimage2"); var counter = 0; var fadeDuration = 2000; var keepImageDuration = 5000; function crossFade() { if (counter % 2 === 0) { layer2.css("background-image", "url(" + bgImages[(counter + 1) % bgImages.length] + ")"); layer2.fadeIn(fadeDuration, function () { setTimeout(crossFade, keepImageDuration); }); } else { layer1.css("background-image", "url(" + bgImages[(counter + 1) % bgImages.length] + ")"); layer2.fadeOut(fadeDuration, function () { setTimeout(crossFade, keepImageDuration); }); } counter++; }; setTimeout(crossFade, keepImageDuration); } $().ready(function () { fadeImages(); }); </script> </head> <body> <!-- BACKGROUND IMAGE FADER BY DUSK0R --> <div class="bgimage" id="bgimage1"> </div> <div class="bgimage" id="bgimage2"> </div> <!-- /BACKGROUND IMAGE FADER BY DUSK0R --> </body> </html> -
dusk0r created this gist
Apr 22, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,63 @@ <html> <head> <style type="text/css"> .bgimage { position: fixed; background-repeat: no-repeat; background-position: center; background-size: cover; background-color: black; width: 100%; height: 100%; } #bgimage1 { /* Initiales Bild */ background-image: url(bg.1.jpg); } #bgimage2 { display: none; } </style> <script type="text/javascript"> function fadeImages() { var bgImages = ["bg.1.jpg", "bg.2.jpg", "bg.3.jpg", "bg.4.jpg"]; var layer1 = $("#bgimage1"); var layer2 = $("#bgimage2"); var counter = 0; var fadeDuration = 2000; var keepImageDuration = 5000; function crossFade() { if (counter % 2 === 0) { layer2.css("background-image", "url(" + bgImages[(counter + 1) % bgImages.length] + ")"); layer2.fadeIn(fadeDuration, function () { setTimeout(crossFade, keepImageDuration); }); } else { layer1.css("background-image", "url(" + bgImages[(counter + 1) % bgImages.length] + ")"); layer2.fadeOut(fadeDuration, function () { setTimeout(crossFade, keepImageDuration); }); } counter++; }; setTimeout(crossFade, keepImageDuration); } $().ready(function () { fadeImages(); }); </script> </head> <body> <!-- BACKGROUND IMAGE FADER BY DUSK0R --> <div class="bgimage" id="bgimage1"> </div> <div class="bgimage" id="bgimage2"> </div> <!-- /BACKGROUND IMAGE FADER BY DUSK0R --> </body> </html>