Headers as links
hey pretty sleek script. can the headers also function as links, so when clicked it scrolls to that section and open the content. something like accordion but slinky.
thanks.
almost two years... i guess project is dead ... sad.. if anyone finds a project like this that has clickable headers please comment a link below. thx.
@mikila85 I have since moved away from jQuery for building web apps. If you or someone else implements this functionality I would have no problem merging it.
Me too i need it for angular project. Tomorrow at work ill try making it work
Hi,
I tried using targeting to reach the requested
any chance to get help from you trying to sort it out?
p.s. i tried doing $(window).scrollTop($("#myanchor").offset().top-(header.height * stackedHeaders); but the offset() is wrong i think that slinky changes it because on test page it worked without slinky.
Got it! :)
when doing: // Pre-calculate the offsets that the headers would have // from the top or bottom of the scroller.
in the foreach i added: headers[i].$.click(function () { scrollToArticle(i); });
and a function
function scrollToArticle(i) { var articleTop = headers[i].$.context.offsetTop - headers[i].top; $scroller.scrollTop(articleTop); }
@mikila85
This functionality is just what I'm looking for! Could you please elaborate on how you modified the core code? perhaps include a demo link? Thanks much!!!