jQuery hash attribute
At 4 minutes into the "Scroll开发者_StackOverflow中文版 Linked Navigation" podcast Posted: Wed, 18 Aug 2010 at jQuery for Designers, Remy uses the hash attribute.
Q: Where is the hash attribute documented?
$('a[hash=#foo]')
isn't explicitly documented, but it makes sense given the following:
A) The Link object has a hash
property.
B) jQuery's "attribute equals selector" works on properties (not just attributes).
https://developer.mozilla.org/en/DOM/window.location
hash
- The part of the URL that follows the # symbol, including the # symbol.
You can listen for the hashchange
event to get notified of changes to the hash in supporting browsers
精彩评论