回答編集履歴
1
調整
test
CHANGED
@@ -1,41 +1 @@
|
|
1
|
-
```javascript
|
2
|
-
|
3
|
-
function changeImgSrc(t){
|
4
|
-
|
5
|
-
if($(t).is('img[src$=".jpg"]:not([src$="-active.jpg"])')){
|
6
|
-
|
7
|
-
$.cookie('imgIndex',$('img').index(t));
|
8
|
-
|
9
|
-
$('img[src$="-active.jpg"]').attr('src',function(){return $(this).attr('src').replace(/-active(?=.jpg$)/,'')});
|
10
|
-
|
11
|
-
$(t).attr('src',$(t).attr('src').replace(/(?=.jpg$)/,'-active'));
|
12
|
-
|
13
|
-
}
|
14
|
-
|
15
|
-
}
|
16
|
-
|
17
|
-
$(window).on('pageshow',function(){
|
18
|
-
|
19
|
-
changeImgSrc($('img').eq($.cookie('imgIndex')));
|
20
|
-
|
21
|
-
});
|
22
|
-
|
23
|
-
$(function(){
|
24
|
-
|
25
|
-
$('a').on('click',function(e){
|
26
|
-
|
27
|
-
|
1
|
+
ごめんなさい、回答する質問間違えました
|
28
|
-
|
29
|
-
changeImgSrc(e.target);
|
30
|
-
|
31
|
-
setTimeout(function(){
|
32
|
-
|
33
|
-
location.href=$(this).closest('a').attr('href');
|
34
|
-
|
35
|
-
}.bind(this),100);
|
36
|
-
|
37
|
-
});
|
38
|
-
|
39
|
-
});
|
40
|
-
|
41
|
-
```
|