質問編集履歴
1
詳しいコードがあった方が良いとのご指摘を頂きましたので、べたっと張ってみました。この関数をすべて表示し終わってから、次のiを代入して同じ関数を動かしたいのですが、上手くいきません。
test
CHANGED
File without changes
|
test
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
[例]
|
10
|
+
|
11
|
+
```ここに言語を入力
|
10
12
|
|
11
13
|
i = 1;
|
12
14
|
|
@@ -46,6 +48,8 @@
|
|
46
48
|
|
47
49
|
|
48
50
|
|
51
|
+
```
|
52
|
+
|
49
53
|
|
50
54
|
|
51
55
|
### 試したこと
|
@@ -59,3 +63,95 @@
|
|
59
63
|
変数iを配列に入れて.each()でできるかなとも思いましたが、単体のli要素を処理する方法しか見つかりませんでした。でも関数でまとめたいので。
|
60
64
|
|
61
65
|
Deferredオブジェクトもダメ元でトライしてみましたが、何のエラーメッセージも無いけれど、1ミリも動きません。
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
//修正・加筆1
|
70
|
+
|
71
|
+
ご指摘ありがとうございます。関数そのままの方が良いとのことなので、そのままベタっと貼ってみました。下記が関数です。
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
```ここに言語を入力
|
76
|
+
|
77
|
+
$(function(){
|
78
|
+
|
79
|
+
//スクロール
|
80
|
+
|
81
|
+
$('div.mouseon_scroll_slide').mouseover(function(){
|
82
|
+
|
83
|
+
$('div.mouseon_scroll_slide').delay(800).animate({'left': '-1950px'}, 44333); //1区分
|
84
|
+
|
85
|
+
});
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
$('li#mp'+i+'.main_bg_photo img').animate({'opacity': 1}, 2500);
|
90
|
+
|
91
|
+
$('div#id_'+i+'.mouseon_scroll_slide').on('mouseover', age_and_text);
|
92
|
+
|
93
|
+
function age_and_text(){
|
94
|
+
|
95
|
+
$('li#lt'+i+'.life_text').fadeIn(800);
|
96
|
+
|
97
|
+
$('li#la'+i+'.life_age').delay(600).fadeIn(800);
|
98
|
+
|
99
|
+
};
|
100
|
+
|
101
|
+
$('div.history_b').on('mouseover', main_photos);
|
102
|
+
|
103
|
+
function main_photos(){
|
104
|
+
|
105
|
+
$('li#lmp'+i+'.life_main_photos').animate({'opacity': 1}, 1000);
|
106
|
+
|
107
|
+
$('li#lmpc'+i+'.life_main_photos_comments').fadeIn();
|
108
|
+
|
109
|
+
$('li#lmpc'+i+'.life_main_photos_comments').animate({'top': '-190px', 'opacity': 1}, 1000);
|
110
|
+
|
111
|
+
};
|
112
|
+
|
113
|
+
$('div.history_c').on('mouseover', snap123);
|
114
|
+
|
115
|
+
function snap123(){
|
116
|
+
|
117
|
+
$('li#p'+i+'.social_snap_photos1').animate({'opacity': 1}, 1000);
|
118
|
+
|
119
|
+
$('li#c'+i+'.social_snap_comments1').fadeIn();
|
120
|
+
|
121
|
+
$('li#c'+i+'.social_snap_comments1').animate({'top': '3px', 'opacity': 1}, 1200); //3pxは停止場所
|
122
|
+
|
123
|
+
$('li#p'+i+'.social_snap_photos2').animate({'opacity': 1}, 2000);
|
124
|
+
|
125
|
+
$('li#c'+i+'.social_snap_comments2').fadeIn();
|
126
|
+
|
127
|
+
$('li#c'+i+'.social_snap_comments2').animate({'top': '3px', 'opacity': 1}, 1600); //3pxは停止場所
|
128
|
+
|
129
|
+
$('li#p'+i+'.social_snap_photos3').animate({'opacity': 1}, 3000);
|
130
|
+
|
131
|
+
$('li#c'+i+'.social_snap_comments3').fadeIn();
|
132
|
+
|
133
|
+
$('li#c'+i+'.social_snap_comments3').animate({'top': '3px', 'opacity': 1}, 2000); //3pxは停止場所
|
134
|
+
|
135
|
+
};
|
136
|
+
|
137
|
+
$('div.history_f').on('mouseover', snap4);
|
138
|
+
|
139
|
+
function snap4(){
|
140
|
+
|
141
|
+
$('li#p'+i+'.social_snap_photos4').animate({'opacity': 1}, 1000);
|
142
|
+
|
143
|
+
$('li#c'+i+'.social_snap_comments4').fadeIn();
|
144
|
+
|
145
|
+
$('li#c'+i+'.social_snap_comments4').animate({'top': '-110px', 'opacity': 1}, 1200); //3pxは停止場所
|
146
|
+
|
147
|
+
};
|
148
|
+
|
149
|
+
});
|
150
|
+
|
151
|
+
});
|
152
|
+
|
153
|
+
```
|
154
|
+
|
155
|
+
この関数に変数を代入し、この関数の処理が終わってから、同じ関数にi++を代入したいのです。
|
156
|
+
|
157
|
+
スクロールは関数から外してしまうこともできますが、取り敢えず組み込んであります。
|