Skip to content

Commit

Permalink
ver 2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeniosegala committed Oct 20, 2017
1 parent 2bd21a6 commit c16296b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 11 deletions.
30 changes: 30 additions & 0 deletions easy_background.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ function easy_background(selector, a1, a2, b1, b2, c1, c2, d1, d2, e1, e2) {
}




function empty_img(x) {
if (x) {
return "<img src='"+ x +"'>";
} else {
return "";
}
}




var p = document.createElement("div");
p.innerHTML = " ";
p.classList.add("easy_slider");


document.body.insertBefore(p, document.body.firstChild);


document.querySelector(".easy_slider").innerHTML = empty_img(a2) + empty_img(b2) + empty_img(c2) + empty_img(d2) + empty_img(e2);


document.querySelector(".easy_slider").style.display = "none";





tot_time = empty_var(a1) + empty_var(b1) + empty_var(c1) + empty_var(d1) + empty_var(e1);

console.log(tot_time);
Expand Down
Binary file added img/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 5 additions & 11 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,14 @@
-o-transition: all 0.5s ease-in;
transition: all 0.5s ease-in;
background-size: cover;
background-repeat: no-repeat;
background-position: center center;
color: white;
height: 100%;
width: 100%;

}


body::after {

content: url("img/1.jpg") url("img/2.jpg") url("img/3.jpg");
display: none;

}


.ct {
height: 95.8vh;
display: flex;
Expand All @@ -52,7 +46,7 @@

<body>

<a href="https://github.com/Sn01k3r/easy_background"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>
<a href="https://github.com/Sn01k3r/easy_background"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/e7bbb0521b397edbd5fe43e7f760759336b5e05f/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f677265656e5f3030373230302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>

<div class="container ct">

Expand All @@ -68,7 +62,7 @@ <h1>easy_background</h1><i style="font-size: 10px;">dev by <a href="https://gith
<script src="easy_background.js"></script>

<script>
easy_background("body", 3000, "img/1.jpg", 3000, "img/2.jpg", 3000, "img/3.jpg"); // CALL THE SLIDER AND SET THE SELECTOR AND IMG
easy_background("body", 3000, "img/1.jpg", 3000, "img/2.jpg", 3000, "img/3.jpg", 3000, "img/4.jpg", 3000, "img/5.jpg");
</script>


Expand Down

0 comments on commit c16296b

Please sign in to comment.