23 / 23 / 1
Регистрация: 27.04.2013
Сообщений: 385
|
|
1
|
почему не работает скрипт
15.12.2013, 22:32. Показов 638. Ответов 5
Всем привет. не пойму почему не работает вот этот блок кода
Javascript | 1
2
| pic.src = "../images/" +arr[indexImg];
pic.setAttribute("alt","arr[indexImg]"); |
|
сам скрипт
Javascript | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
| $( document ).ready(function(){
left_slider = $('.left_slider'),
pic = $("#picture"),
indexImg = 0,
arr = new Array ("1.png","2.jpg","3.jpg","4.jpg"),
phase = 3000;
function change () {
pic.fadeOut(500);
pic.src = "../images/" +arr[indexImg];
pic.setAttribute("alt","arr[indexImg]");
pic.fadeIn(500);
}
function autoCange () {
indexImg++;
if(indexImg >= arr.length) {
indexImg = 0;
}
change ();
}
var interval = setInterval(autoCange, phase);
left_slider.mouseover(function() {
clearInterval(interval);
});
left_slider.mouseout(function() {
interval = setInterval(autoCange, phase);
});
//elWrap.append('<span class="next"></span><span class="prev"></span>');
var btnNext = $('.slider_buttons img:first-child'),
btnPrev = $('.slider_buttons img:last-child');
btnNext.click(function() {
indexImg++;
if(indexImg >= arr.length) {
indexImg = 0;
}
change ();
});
btnPrev.click(function() {
indexImg--;
if(indexImg <=0) {
indexImg =arr.length-1;
}
change ();
});
}); |
|
HTML5 | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
| <!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="initialscale=1.0, width=device-width" />
<title>max-width</title>
<link rel="stylesheet" href="width.css">
<link type="text/css" rel="stylesheet" href="style.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</head>
<body>
<div id="all">
<div class="wrapper">
<header class="header">
<div class="left_part"><img src="https://www.cyberforum.ru/images/logo.png" alt="logo"><span>Lipsum</span></div>
<div class="right_part">
<span>Lorem ipsum dolor sit amet</span><br>
<span> consectetur adipisicing elit, sed do eiusmod tempor incididunt
</span>
</div>
</header>
<nav class="navigation">
<ul>
<li><a href="">home</a></li>
<li><a href="">products</a></li>
<li><a href="">news</a></li>
<li><a href="">about us</a></li>
<li><a href="">contact us</a></li>
</ul>
</nav>
<main class="content">
<h3>featured Products</h3>
<div class="products">
<div class="left_slider">
<div class="figure0">
<img id = "picture">
</div>
<div class="slider_buttons">
<img src="https://www.cyberforum.ru/images/left.png" alt="slide">
<span>Lipsum comoodo Manager</span>
<img src="https://www.cyberforum.ru/images/right.png" alt="slide">
</div>
</div>
<div class="right_slider">
<div class="figure1">
<img src="https://www.cyberforum.ru/images/buda.png" alt="buda">
</div>
<span>
The mission of Orlin Research, Inc. is to produce software products that multiply the power and efficiency of empirical scientific research in the social sciences.
A central goal is to expand access to complex data sources and to the advanced methods of scientific investigation needed to analyze them.
</span>
</div>
</div>
<section class="bottom">
<div class="left_bottom_col">
<h3>Latest News</h3>
<div>
<div class = "date"><span>27</span><br>nov</div>
<div>
<h4>An early access preview</h4>
An early access preview of the Orlin Data<br> Manager is available..
</div>
</div>
<div>
<div class = "date"><span>27</span><br>nov</div>
<div>
<h4>An early access preview</h4>
An early access preview of the Orlin Data<br> Manager is available..
</div>
</div>
<div>
<div class = "date"><span>27</span><br>nov</div>
<div>
<h4>An early access preview</h4>
An early access preview of the Orlin Data<br> Manager is available..
</div>
</div>
</div>
<div class="center_bottom_col">
<h3>Who We are ?</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<div>
<span>More</span>
<span>></span>
</div>
</div>
<div class="right_bottom_col">
<h3>Contact Us</h3>
<div><img src="https://www.cyberforum.ru/images/mobile.png" alt="mobile"><span>(626) 921-4592</span></div>
<div><img src="https://www.cyberforum.ru/images/tel.png" alt="tel"><span>(626) 921-4592</span> </div>
<div><img src="https://www.cyberforum.ru/images/mail.png" alt="mail"><span>info@orlinresearch.com</span></div>
<div>
<img src="https://www.cyberforum.ru/images/home.png" alt="home"><span>Orlin Research Inc.7412 Ridgewood AveChevy Chase, MD 20815 USA</span>
</div>
</div>
</section>
</main>
</div>
<div class="buffer"></div>
<div class="footer">
<div>
<ul class="clients">
<li><img src="https://www.cyberforum.ru/images/att.png" alt="att"></li>
<li><img src="https://www.cyberforum.ru/images/inc.png" alt="inc"></li>
<li><img src="https://www.cyberforum.ru/images/auto.png" alt="auto"></li>
<li><img src="https://www.cyberforum.ru/images/visa.png" alt="visa"></li>
<li><img src="https://www.cyberforum.ru/images/polar.png" alt="polar"></li>
<li><img src="https://www.cyberforum.ru/images/gap.png" alt="gap"></li>
</ul>
</div>
<div class="lipsum">
<div>
<img src="https://www.cyberforum.ru/images/logo.png" alt="logo">
<span>Lipsum</span>
</div>
</div>
<div class="footer_links">
<ul>
<li><a href="">Home</a></li>
<li><a href="">About us</a></li>
<li><a href="">work</a></li>
<li><a href="">services</a></li>
<li><a href="">resources</a></li>
<li><a href="">articles</a></li>
<li><a href="">contact</a></li>
</ul>
</div>
<div class="copy">
<span>©2009 </span><span>Orlin Research, Inc</span>
</div>
</div>
</div>
</body>
</html> |
|
0
|