9

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 !

9
  • stackoverflow.com/questions/15158937/… Commented Jun 19, 2013 at 10:05
  • You want to scroll(slide) to specific page, right? curtain.js is using <li> tag as full screen. Commented Jun 19, 2013 at 10:09
  • @Joonas I tried the first example of the post u sent me but it gives me TypeError: $(...).offset(...) is null Commented Jun 19, 2013 at 10:13
  • It gives you that error in this jsfiddle: jsfiddle.net/lollero/ZVdRt? or the code gives you error after you implement it into your website? Commented Jun 19, 2013 at 10:21
  • after i tried it in my website Commented Jun 19, 2013 at 10:23

1 Answer 1

2

UPDATE

Try this one, if you want a menu and menu links to specific page. It will scroll to your page with curtain effect.

DEMO http://jsfiddle.net/yeyene/mCytP/2/

Add menu outside of ol, then add links with your li page id in href.

<div id="menu">
    <ul>
        <li><a href="#home" class="curtain-links curtain-links-active">Home</a></li>
        <li><a href="#about_us" class="curtain-links">About Us</a></li>
        <li><a href="#portfolio" class="curtain-links">Portfolio</a></li>
        <li><a href="#programs" class="curtain-links">Programs</a></li>
     </ul>
</div>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.