It's hard to describe the whole problem but to make a long story short, I can't use href="...#something" but I need this functionality. Is there a way to replicate it with jquery? So I want to have something like this onclic开发者_运维百科k="$('div#something').jumpThere();" but I don't know the exact name of the function. Could you please let me know whether jquery has such function and if yes, how it is called.
You don't need jQuery
window.location.hash = '#something';
should do it.
Difficult. But i would look into on click, getting the .position() of the element you want to go to. Then setting the window.scrollTop to that value (this will only work in some situations). That would be where I would start: .position() and window.scrollTop
精彩评论