axyz / middleman-zurb-foundation

Middleman Skeleton For Zurb Foundation
92 stars 22 forks source link

Active Links #4

Open ndavidson opened 10 years ago

ndavidson commented 10 years ago

How can you add active class to nav items after page has loaded? I can only find HAML solutions.

axyz commented 10 years ago

Hi there, Foundation is essentially a front end framework, so it leaves to the programmer the task to change classes accordingly to the events. It could be quite easy to implement using simple jquery(or better native DOM selection). I think I've seen on stackoverflow the ruby only solution that uses haml which you are referring to, maybe it could be translated in erb which is the default templating engine used on this repo, by the way, while it could be cool to use full ruby and middleman to do it, i don't like the idea of mixing program logic with the presentation layer so i think the cleanest solution is to implement it inside the script.js.coffee file or wathever is your main js file.