on-anchor-click?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Egbert Teeselink

    on-anchor-click?

    Hi guys,

    A DOM-related question here, hope it's the right group..

    Upon entering a page, i get an onload() event which I'm a happy taker of.
    Now, if within the same page, the user travels to an anchor (i.e. a link
    with href="#somethin g"), is there any way for me to capture this? I'm
    trying to use anchors for hiding/expanding various articles on my site, so
    that i get nice dynamic behaviour, but still a matching address bar and
    working browser history.. is this possible?

    Thanks,

    -egbert
  • Diego La Monica

    #2
    Re: on-anchor-click?

    On 15 Nov, 17:46, "Egbert Teeselink" <skreb...@gmail .comwrote:
    Hi guys,
    >
    A DOM-related question here, hope it's the right group..
    >
    Upon entering a page, i get an onload() event which I'm a happy taker of. 
    Now, if within the same page, the user travels to an anchor (i.e. a link  
    with href="#somethin g"), is there any way for me to capture this? I'm  
    trying to use anchors for hiding/expanding various articles on my site, so  
    that i get nice dynamic behaviour, but still a matching address bar and  
    working browser history.. is this possible?
    >
    Hi Egbert,
    i think that you can follow 2 ways:

    the first is to monitor the url and (when changes happens) you can
    store your data into somewhere to create your history.
    The second way is to attach an event to the anchor and for each click
    you can store click history.

    That's all.
    ---
    Diego La Monica (IWA/HWG)
    http://jastegg.it/ - JAvaScript Toolkit
    http://jastegg.it/jastASlide/ - Simple, Standard, Crossbrowser and
    Accessible way to make your slides!

    Comment

    Working...