diff --git a/README.md b/README.md index 35acdcd..5c87795 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,15 @@ Temat na forum: http://forum.pasja-informatyki.pl/165441 --- -Ten branch zawiera oryginalny, niemodyfikowany kod odcinka. Na pozostałych branchach znajdują się odpowiednie poprawki. +### Zmiany +#### HTML +- Usunięto nadmiarowe tagi `` typu `` +- Listę wyboru obrazka zmieniono na HTML-ową listę +- Usunięto atrybuty `onload` na rzecz wywoływania funkcji pod koniec skryptu + +#### JS +- Przeniesiono skrypty do stosownych plików `.js` + +#### CSS +- Przeniesiono style do stosownych plików `.css` +- Przepisano powtarzającą się zawartość strony (\[ 0 ] \[ 1 ] \[ 2 ] …) jako reguły CSS \ No newline at end of file diff --git a/slider.html b/slider.html deleted file mode 100644 index df7ea69..0000000 --- a/slider.html +++ /dev/null @@ -1,69 +0,0 @@ - - - -
- - - - - - - - - - - - [ 1 ] - [ 2 ] - [ 3 ] - [ 4 ] - [ 5 ] - - - - - \ No newline at end of file diff --git a/slajdy/slajd1.png b/slider/slajdy/slajd1.png similarity index 100% rename from slajdy/slajd1.png rename to slider/slajdy/slajd1.png diff --git a/slajdy/slajd2.png b/slider/slajdy/slajd2.png similarity index 100% rename from slajdy/slajd2.png rename to slider/slajdy/slajd2.png diff --git a/slajdy/slajd3.png b/slider/slajdy/slajd3.png similarity index 100% rename from slajdy/slajd3.png rename to slider/slajdy/slajd3.png diff --git a/slajdy/slajd4.png b/slider/slajdy/slajd4.png similarity index 100% rename from slajdy/slajd4.png rename to slider/slajdy/slajd4.png diff --git a/slajdy/slajd5.png b/slider/slajdy/slajd5.png similarity index 100% rename from slajdy/slajd5.png rename to slider/slajdy/slajd5.png diff --git a/slider/slider.css b/slider/slider.css new file mode 100644 index 0000000..369a181 --- /dev/null +++ b/slider/slider.css @@ -0,0 +1,26 @@ +body +{ + background-color: #222222; + font-size: 24px; + color: white; +} + +.slider-list +{ + list-style-type: none; + padding: 0; + margin: 0; + counter-reset: slider-list-counter; +} + +.slider-list > * +{ + cursor: pointer; + display: inline-block; +} + +.slider-list > *::before +{ + counter-increment: slider-list-counter; + content: "[ " counter(slider-list-counter) " ]"; +} \ No newline at end of file diff --git a/slider/slider.html b/slider/slider.html new file mode 100644 index 0000000..7025444 --- /dev/null +++ b/slider/slider.html @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/slider/slider.js b/slider/slider.js new file mode 100644 index 0000000..40d07e0 --- /dev/null +++ b/slider/slider.js @@ -0,0 +1,34 @@ +var numer = Math.floor(Math.random()*5)+1; + +var timer1 = 0; +var timer2 = 0; + +function ustawslajd(nrslajdu) +{ + clearTimeout(timer1); + clearTimeout(timer2); + numer = nrslajdu - 1; + + schowaj(); + setTimeout("zmienslajd()", 500); +} + +function schowaj() +{ + $("#slider").fadeOut(500); +} + +function zmienslajd() +{ + numer++; if (numer>5) numer=1; + + var plik = "