Closed leslc closed 10 years ago
With your getAttribute
change you're intercepting external links as well and they stop working when they contain a hash, e.g. https://github.com/Prinzhorn/skrollr#resources (#resources
)
Can you explain this a bit more? The current handleClick
function exits if getAttribute("href")
is not a hashlink (checked by the regular expression), so I thought external links aren't valid for the skrollr menu?
Your code will run for external links as well, if they have a hash.
Nevermind. I missunderstood the second parameter. I just looked at the msdn docu.
Is there a browser for which link.getAttribute('href', 2)
won't work? Chrome and FF don't complain.
I did fix the IE7 Problem with var r = t.getAttribute("href"); link = window.location.href.split('#'); r = r.replace(link[0], '');
but was an older version of the skrollr-menu where i also needed to replace hasAttribute with (typeof(t.getAttribute(n)) !== 'undefined')
I'm closing this as it was only meant as a reference for other IE 7 users anyway.
Thanks Alex for your contribution!
I don't know if IE7 is officially supported for this (and you probably don't want to! :).
For others who want to support IE7 browsers, here are some changes I made to skrollr-menu. I'll probably branch these changes if I have more time later.
1) For "var href = link.getAttribute('href') " - Unfortunately IE7 will return the full URL instead of the actual text inside "href". You need to use some extra flag in getAttribute.
2) Since IE7 doesn't set "e.which" or "e.button" for click events, assume every click is valid.
Hope this is helpful to someone.
(EDITED: removed "mousedown" solution which had too many unintended consequences)