pixxelfactory / jInvertScroll

A lightweight jQuery vertical scroll - horizontal move plugin with parallax effect.
http://www.pixxelfactory.net/jInvertScroll
MIT License
786 stars 156 forks source link

Anchors issues #2 #6

Closed newenth closed 10 years ago

newenth commented 10 years ago

Hi,

i read the previous issue concerning anchors but it still doesn't work to me..

You said this: Html (add this after the nav-element):

But, what shall we insert inside the html document?

And this for the stylsheet: .anchors { position: relative; }

.anchors #100 { position: absolute; top: 0; }

.anchors #200 { position: absolute; top: 850px; }

.anchors #300 { position: absolute; top: 1700px; }

.anchors #400 { position: absolute; top: 2550px; }

When i tryed something like this, the anchor pushed the scrollbar everytime. Like if i wrote "top 1000px" every time i click on the anchor will scroll down the page for 1000px.

Is there any solution on this issue at the moment?

ty very much. Newenth.

pixxelfactory commented 10 years ago

Hi, we are planning an update that integrates automatic navigation. But at the moment we are a little bit busy (since in 2 weeks it's christmas ;-) ).

Can you send me a message with the url of the site you are developing, i will take a brief look into it to help you solve the problem. =)

Sincerly pixxelfactory

pixxelfactory commented 10 years ago

No message or response, so closed...

Axelle21 commented 10 years ago

Hi,

I have the same problem for my website. Can you help me ? Or the update is already available ?

Thank you for your help !

Axelle

pixxelfactory commented 10 years ago

Hi, can you send me a link containing the url of your site?

Axelle21 commented 10 years ago

Hi,

Yep': http://courvoisier.ch/test/

pixxelfactory commented 10 years ago

Hi, use this:

$('#menu a').on('click', function(e) { e.preventDefault(); var target = $(this).attr('href'); var pos = $(target).parents('.page').position().left; var scrollPercent = (pos / ($('.front.scroll').width() - window.innerWidth)).toFixed(4); var top = scrollPercent * ($('body').height() - window.innerHeight); $('html, body').animate({scrollTop: top+'px'}, 200); });

Cheers Pixxelfactory

Axelle21 commented 10 years ago

Yesss thank you very much! :) it works :)

pixxelfactory commented 10 years ago

You're welcome =)