"target" attribute on areas not working with clickNavigate
See original GitHub issueWithout ImageMapster, you can use target="_blank"
to open a new window. ImageMapster interevenes and uses javascript to navigate. We need to simulate target
options when navigating.
Issue Analytics
- State:
- Created 11 years ago
- Comments:20 (4 by maintainers)
Top Results From Across the Web
anchor tag “target” attribute is not working - Stack Overflow
target Specifies where to display the linked URL. It is a name of, or keyword for, a browsing context: a tab, window, or...
Read more >document - ImageMapster
a boolean attribute that will be added or removed from list target elements when its corresponding map area is selected or deselected. listSelectedClass:...
Read more >HTML a target Attribute - W3Schools
The target attribute specifies where to open the linked document: <a href="https://www.w3schools.com" target="_blank">Visit W3Schools</a>.
Read more >Solved: target="_blank" in UI macro isnt working - ServiceNow
Hi All,. I need to redirect user to a new page when the CLICK on a the below link, but it isnt working....
Read more >whitet teenage girls - macellerialucio.it
It's not known if Lady Caroline posed for the work or if it's from ... system that targets very specifically where only teenage...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
OK - problems with the file at github - don’t ask.
Thought I had figured out my error, pasted again - but got the same result.
New id is : 8478644
Solution:
Lord knows why github processed the file I sent up this way - I have asked.
Well, I have just checked gist - and it is there
https://gist.github.com/NKarasek/847864
OK - this is getting ridiculous - and probably I’m to blame but can’t see exactly how/why.
I’ve put the file in my own js directory for you which can be referenced via:
script type=“text/javascript” src=“http://www.tbkd.org/js/jquery.imagemapster_NZK.js”> /script>
edit the script tabs as before
Anyway - the .js file you will end up with has all four of my updates
I added comments at the top of the .js file - they should get you on track.
Sorry for the confusion - I’m still trying to figure out github.
Nick
For both examples, click the word (not the state) vermont. (Btw. if you have multiple areas grouped, you’ll need to either reproduce the target/href on each one, or use a cross reference of some kind).
For just simulating “_blank” in config: http://jsfiddle.net/jamietre/ynYmX/12/
This should be good enough for most situations, however,
window.open
does not work exactly the same astarget="_blank"
and might be more susceptible to ad blockers.A more complete way is to actually let the browser do it by creating and clicking a link. This uses a function to simulate a browser click I found here: http://stackoverflow.com/questions/1421584/how-can-i-simulate-a-click-to-an-anchor-tag
Example:
The fakeClick function: