Skip to content

Commit 2fee6e5

Browse files
committed
styles, scripts moved to their respective files
1 parent c6ed933 commit 2fee6e5

File tree

16 files changed

+118
-136
lines changed

16 files changed

+118
-136
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ Temat na forum: http://forum.pasja-informatyki.pl/165441
1010
#### HTML
1111
(jeszcze nic)
1212
#### JS
13-
(jeszcze nic)
13+
- Przeniesiono skrypty do stosownych plików `.js`
14+
#### CSS
15+
- Przeniesiono style do stosownych plików `.css`

slider.html

Lines changed: 0 additions & 69 deletions
This file was deleted.

slider/slider.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
body
2+
{
3+
background-color: #222222;
4+
font-size: 24px;
5+
color: white;
6+
}

slider/slider.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="pl">
3+
<html>
4+
<head>
5+
<meta charset="utf-8" />
6+
<link rel="stylesheet" href="slider.css" />
7+
</head>
8+
<body onload="zmienslajd()">
9+
10+
<span onclick="ustawslajd(1)" style="cursor:pointer;">[ 1 ]</span>
11+
<span onclick="ustawslajd(2)" style="cursor:pointer;">[ 2 ]</span>
12+
<span onclick="ustawslajd(3)" style="cursor:pointer;">[ 3 ]</span>
13+
<span onclick="ustawslajd(4)" style="cursor:pointer;">[ 4 ]</span>
14+
<span onclick="ustawslajd(5)" style="cursor:pointer;">[ 5 ]</span>
15+
16+
<div id="slider"></div>
17+
18+
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
19+
<script src="slider.js"></script>
20+
</body>
21+
</html>

slider/slider.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var numer = Math.floor(Math.random()*5)+1;
2+
3+
var timer1 = 0;
4+
var timer2 = 0;
5+
6+
function ustawslajd(nrslajdu)
7+
{
8+
clearTimeout(timer1);
9+
clearTimeout(timer2);
10+
numer = nrslajdu - 1;
11+
12+
schowaj();
13+
setTimeout("zmienslajd()", 500);
14+
}
15+
16+
function schowaj()
17+
{
18+
$("#slider").fadeOut(500);
19+
}
20+
21+
function zmienslajd()
22+
{
23+
numer++; if (numer>5) numer=1;
24+
25+
var plik = "<img src=\"slajdy/slajd" + numer + ".png\" />";
26+
27+
document.getElementById("slider").innerHTML = plik;
28+
$("#slider").fadeIn(500);
29+
30+
timer1 = setTimeout("zmienslajd()", 5000);
31+
timer2 = setTimeout("schowaj()", 4500);
32+
}

0 commit comments

Comments
 (0)