7

Hello am having a great problem scrolling the page to a specific element on page using jquery or javascript.

I've tried many ways of doing it but i failed in all of them. the website is implemented using the framework library called curtain.js https://github.com/victa/curtain.js.

The ways I have tried include:

1)https://developer.mozilla.org/en-US/docs/Web/API/element.scrollIntoView?redirectlocale=en-US&redirectslug=DOM%2Felement.scrollIntoView

2)How to go to a specific element on page?

3) I even tried the simplest way using anchor tags but nothing happens.

the only way that worked was scrollTop() as you can see from other links on the page. Unfortunately this doesn't work for me since this fails on different screen sizes.

you can see example of the site at http://pagota.herobo.com

Thanks !

Community
  • 1
  • 1
anjelott1
  • 1,123
  • 4
  • 21
  • 35
  • http://stackoverflow.com/questions/15158937/jquery-jump-or-scroll-to-certain-position-div-or-target-on-the-page-from-button/15159396#15159396 – Joonas Jun 19 '13 at 10:05
  • You want to scroll(slide) to specific page, right? curtain.js is using
  • tag as full screen.
  • – yeyene Jun 19 '13 at 10:09
  • @Joonas I tried the first example of the post u sent me but it gives me TypeError: $(...).offset(...) is null – anjelott1 Jun 19 '13 at 10:13
  • It gives you that error in this jsfiddle: http://jsfiddle.net/lollero/ZVdRt/? or the code gives you error after you implement it into your website? – Joonas Jun 19 '13 at 10:21
  • after i tried it in my website – anjelott1 Jun 19 '13 at 10:23
  • It seems like it is not finding the offset of your element for some reason. Try isolating the issue by first trying that code in a simple document with just the bare essentials. – Joonas Jun 19 '13 at 10:26
  • use http://lions-mark.com/jquery/scrollTo/ – Irfan DANISH Jun 19 '13 at 10:28
  • If `.offset` returns null, then you are trying to select the element before it exists. Please see http://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element. – Felix Kling Jun 19 '13 at 10:55
  • @ak_47 If you want menu, add a menu outside of ol, then add links with your li page id in href. Check my answer in answer section. – yeyene Jun 19 '13 at 10:58