回答編集履歴

2

再修正

2015/09/13 08:31

投稿

garamond
garamond

スコア150

test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  $('header').on('click', function(e){
4
4
 
5
- if (e.pageY - $(this).potion().top < 135) {
5
+ if (e.pageY < 135) {
6
6
 
7
7
  $(this).css('z-index', 0);
8
8
 

1

コード修正

2015/09/13 08:31

投稿

garamond
garamond

スコア150

test CHANGED
@@ -1,7 +1,19 @@
1
1
  ```JavaScript
2
2
 
3
- $('header').css('z-index', 0);
3
+ $('header').on('click', function(e){
4
+
5
+ if (e.pageY - $(this).potion().top < 135) {
6
+
7
+ $(this).css('z-index', 0);
8
+
9
+ } else {
10
+
11
+ $(this).css('z-index', -1);
12
+
13
+ }
14
+
15
+ });
4
16
 
5
17
  ```
6
18
 
7
- とかでできると思いますが、マイナス値は使えなかったと思います。
19
+ とかでできると思いますが、z-index にマイナス値は使えなかったと思います。