質問編集履歴

4

誤字修正しました

2019/01/26 13:32

投稿

mametaro3
mametaro3

スコア13

test CHANGED
File without changes
test CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  area[shap="rect"]がクリックされたときは、同じhrefが指定されているarea[shap="circle"]だけがクリックされたことにしたいです。
26
26
 
27
- しかし現状では`$('area[shape="circle"][href="' + $(this).attr("href") + '"]').click()`で、再度`$(this).click(function (e) {`が呼ばれているのですが、eの値が取れていないためe.pageYなどが取れない状況です。
27
+ しかし現状では`$('area[shape="circle"][href="' + $(this).attr("href") + '"]').click()`で、再度`$(this).click(function (e) {`が呼ばれているのですが、eの値が取れていないためe.pageYなどが取れない状況です。
28
28
 
29
29
 
30
30
 

3

編集・追記依頼の反映

2019/01/26 13:32

投稿

mametaro3
mametaro3

スコア13

test CHANGED
File without changes
test CHANGED
@@ -17,6 +17,18 @@
17
17
 
18
18
 
19
19
  ご回答お待ちしております。よろしくお願いいたします。
20
+
21
+
22
+
23
+ ### 質問追記
24
+
25
+ area[shap="rect"]がクリックされたときは、同じhrefが指定されているarea[shap="circle"]だけがクリックされたことにしたいです。
26
+
27
+ しかし現状では`$('area[shape="circle"][href="' + $(this).attr("href") + '"]').click()`で、再度`$(this).click(function (e) {`が呼ばれているうのですが、eの値が取れていないためe.pageYなどが取れない状況です。
28
+
29
+
30
+
31
+ eの値がちゃんと取れるようになりarea[shap="circle"]のe.pageY,e.pageXの値が取れるようにさせたいです。
20
32
 
21
33
 
22
34
 

2

記述ミス修正

2019/01/26 13:24

投稿

mametaro3
mametaro3

スコア13

test CHANGED
File without changes
test CHANGED
@@ -60,7 +60,7 @@
60
60
 
61
61
  // ここでクリックさせた要素のイベントオブジェクトをとりたい
62
62
 
63
- $('area[shape="circle"][href^=' + $(this).attr("href") + '"]').click();
63
+ $('area[shape="circle"][href="' + $(this).attr("href") + '"]').click();
64
64
 
65
65
  return;
66
66
 

1

記述ミス修正

2019/01/25 13:11

投稿

mametaro3
mametaro3

スコア13

test CHANGED
File without changes
test CHANGED
@@ -60,7 +60,7 @@
60
60
 
61
61
  // ここでクリックさせた要素のイベントオブジェクトをとりたい
62
62
 
63
- $('area[shap="circle"][href^=' + $(this).attr("href") + '"]').click();
63
+ $('area[shape="circle"][href^=' + $(this).attr("href") + '"]').click();
64
64
 
65
65
  return;
66
66