Recommended Answers
Jump to PostThis should be rather simple to do with jQuery, unless I'm misunderstanding what you're asking. First retrieve how many pixels from the top of the webpage the attribute you want to scroll to is. Here, we select the first element that has
data-attr=foo
and then calculate its position in …
Jump to PostThere are many ways to skin a cat and each and every way is up for a debate, also mine, but you're overcomplicationg things with your logic in the HTML, in the CSS and in your jQuery. Some don't make much or any sense either.
It's best practice to scroll …
All 6 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.