質問編集履歴
2
javascriptの編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -25,9 +25,9 @@
|
|
25
25
|
```
|
26
26
|
|
27
27
|
```javascript
|
28
|
-
var biggestWidth = $(".
|
28
|
+
var biggestWidth = $(".area").width();
|
29
29
|
var array1 = [];
|
30
|
-
$('.
|
30
|
+
$('.contents').each(function(i){
|
31
31
|
var boxWidth = $(this).width() + (i + 1);
|
32
32
|
array1.push(boxWidth);
|
33
33
|
});
|
1
javascriptの編集
title
CHANGED
File without changes
|
body
CHANGED
@@ -25,17 +25,18 @@
|
|
25
25
|
```
|
26
26
|
|
27
27
|
```javascript
|
28
|
-
$(function(){
|
29
|
-
$(window).on('load resize', function() {
|
30
|
-
|
28
|
+
var biggestWidth = $(".sec__bg").width();
|
29
|
+
var array1 = [];
|
31
|
-
|
30
|
+
$('.box').each(function(i){
|
32
|
-
if ($(this).width() > biggestWidth ) {
|
33
|
-
|
31
|
+
var boxWidth = $(this).width() + (i + 1);
|
32
|
+
array1.push(boxWidth);
|
33
|
+
});
|
34
|
+
console.log(array1);
|
35
|
+
|
36
|
+
$.each(array1, function(index, elem){
|
37
|
+
if(elem > biggestWidth){
|
38
|
+
biggestWidth = elem;
|
34
|
-
|
39
|
+
}
|
40
|
+
console.log(biggestWidth);
|
35
|
-
|
41
|
+
});
|
36
|
-
$(".area").each(function(){
|
37
|
-
$(this).width(biggestWidth);
|
38
|
-
});
|
39
|
-
})
|
40
|
-
})
|
41
42
|
```
|