Hiilo
Posts: 4
Joined: Wed Dec 11, 2013 1:42 pm

hs.updateAnchors() not working.

Hi.
I'm trying to get highslide to recognise anchors that are added to the dom on runtime.
Basically gallery images that are added to the page via ajax.
I have searched the forum's and all fingers point to the updateAnchors() function, but I cant get it working.
Heres my fiddle http://jsfiddle.net/Hiilo/hJ5xd/

I did some digging through the core files and it seems to me that the updateAnchors fails because the dynamically added a tag does not have it's onclick property set.
updateAnchors uses the isHsAnchor function, which check's for the onclick property of the a tag, but mine are empty
because I want to have them to be unObtrusive.
If I have the onclick property of the dynamically added tag written inline, then everything works fine.

So how would I set the onclick property for the dynamically generated tags?
Any pointer's much appreciated .
Fusher
Posts: 7912
Joined: Mon Jan 30, 2012 10:16 am

Re: hs.updateAnchors() not working.

I think this may be not possible in an easy way. You can try to call hs.setClickEvents() to update all onClick events. See: http://jsfiddle.net/hJ5xd/20/

There is still weird loader gif, you may need to hide it onAfterExpand.
Paweł Fus
Highcharts Developer

Return to “Highslide JS Usage”