I tried inspecting the elements for this website, but I could not figure out how they got the CSS triangle to move to different nav elements when a different page anchor is clicked.
See website: http://www.simple.com
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The arrow is a CSS sprite contained in
http://simple.com/img/sprites.png. It’s set up in the CSS with transitions as follows:That does the animation when the
leftproperty of the CSS changes. Theleftproperty is altered by Javascript hooked from the main navigation library that drives the site, NavSimple, in the (customised and minified)https://www.simple.com/js/brawndo.min2175719530.js. The more general NavSimple code to do the navigation also triggers custom Javascript that moves the arrow’s left position to halfway along the active navigation element (it’s subtracting eleven pixels because the arrow is 22 pixels wide):And that’s basically how it works. Nice site, very well-engineered, I’d say. (The navigation arrow is actually a
divcontaining a letter “V”, so it’ll still look like an arrow even if the background images don’t load, which I thought was a nice touch.)Having said all that, I think this question might be a bit too specific to survive…