teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

2

再修正

2015/09/13 08:31

投稿

garamond
garamond

スコア150

answer CHANGED
@@ -1,6 +1,6 @@
1
1
  ```JavaScript
2
2
  $('header').on('click', function(e){
3
- if (e.pageY - $(this).potion().top < 135) {
3
+ if (e.pageY < 135) {
4
4
  $(this).css('z-index', 0);
5
5
  } else {
6
6
  $(this).css('z-index', -1);

1

コード修正

2015/09/13 08:31

投稿

garamond
garamond

スコア150

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