html - jquery closest anchor in view port -
I am developing a one page website where I have two images on the "joystick" on that page, I have many anchors I have another behavior Want - When a user clicks on the up or down arrow, I want to scroll the page to the nearest anchor on the page. - When the user clicks " above ", the last anchor button and the closest " anchor " when the user clicks the down arrow because My scroller has been stabilized, JS Fidel: Any help would be greatly appreciated You can try doing something like this: mouseover Down Navigation, I can easily manage it with jquery
.scroll () method and jquery
.closest () jquery method does not work. What is the way to find the nearest anchors in the viewport?
http://jsfiddle.net/8vW6n/1/
$ (". Joystick .down"). Click (function () {var anchors = $ ('. Page & gt; a'); var anchorpopss = []; Anchors.each (function (ind, anch) {anchorpositions.push (anch.getBoundingClientRect (). );}); Var i; for (i = 0; i
Comments
Post a Comment