Coder Social home page Coder Social logo

Comments (10)

pixxelfactory avatar pixxelfactory commented on August 12, 2024

Hi, thanks for your feedback, how does it behave in detail? Does it jump to the wrong position or does it not jump at all? How did you implement the links? Standard a-tags to the anchors or some custom jQuery animation?

from jinvertscroll.

wad3inthewater avatar wad3inthewater commented on August 12, 2024

No animation, just standard anchor tags in an ul pointing to divs with ids. It doesn't jump to the link, instead it just pushes the tag down a bit each click no matter which link i click. So if i repeating click any given link i reach the bottom of the page.

I originally wanted to make it work with a smooth scrolling plugin but saw the issue and stripped it down to just regular a-tags and the problem still came up. I can send a link to the page I mocked up a bit later.

from jinvertscroll.

pixxelfactory avatar pixxelfactory commented on August 12, 2024

Yes, please send us a link, so we can look into the issue.

from jinvertscroll.

wad3inthewater avatar wad3inthewater commented on August 12, 2024

Heres a link to a modified version of the example page you guys provide. If i place the content i want to navigate to with links inside a div that has the horizontal js applied to it, the links don't work correctly on the content. If I remove the class thats hooks the js in, then the nav works normally. Not sure if theres something I might not being doing, but thought this might be an issue with the plugin.

http://wadefuller.com/test/tester/

from jinvertscroll.

johannalexander avatar johannalexander commented on August 12, 2024

I've also tried adding normal anchor tags < a href="#about">About and linking it to < div id="about" style="width: 960px;left: 3800px;">About Us</ div> and it doesn't link up. Does it have something to do with it scrolling horizontally and not vertically.

By the way, the plugin is awesome! Very intuitive.

from jinvertscroll.

pixxelfactory avatar pixxelfactory commented on August 12, 2024

Hi, we gave a look at the example you provided and the issue you have.
To link at parts of the page, you have to create some anchor tags and position them vertically, for your example the code would be:

Html (add this after the nav-element):

Stylesheet:
.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;
}

At the moment you need to create these elements manually,
since the plugin does not auto-generate this markup currently.

Let me know if it works, so i can close the issue.

Best regards
Pixxelfactory

from jinvertscroll.

johannalexander avatar johannalexander commented on August 12, 2024

It looks like it works! The anchors are grouped below the nav and above the content separately. Thanks!

from jinvertscroll.

Blackcoreweb avatar Blackcoreweb commented on August 12, 2024

Hello,
Is the example on the specific page working?
I have exactly the same issue. My sample page is http://www.beta.dart.com.cy/mf/

Can you please advise how to make anchors work?

Thanks in advance,

from jinvertscroll.

pixxelfactory avatar pixxelfactory commented on August 12, 2024

Hi,

as stated above, you need to create a container div, wich holds the invisible anchors, for your example this would be:

<div class="anchors">
<a name="home" id="home"></a>
<a name="products" id="products"></a>
<a name="health" id="health"></a>
<a name="wheretobuy" id="wheretobuy"></a>
<a name="contact" id="contact"></a>
</div>

Then, exchange your current links with one that link to the actual anchors like this:
<div class="menu-holder">
<a class="menu-home" href="#home"></a>
<a class="menu-products" href="#products"></a>
<a class="menu-health" href="#health"></a>
<a class="menu-wheretobuy" href="#wheretobuy"></a>
<a class="menu-contact" href="#contact"></a>
</div>

Add the anchor positioning to your styles:
.anchors a
{
display: block;
position: absolute;
}

#home
{
top: 1800px;
}

#products
{
top: 3650px;
}

#health
{
top: 5250px;
}

#wheretobuy
{
top: 6900px;
}

#contact
{
top: 7500px;
}

And finally, change your current menu scrolling script with this one:
$('.nav a').on('click', function(e) {
e.preventDefault();
var top = $($(this).attr('href')).position().top;
$('html, body').animate({scrollTop: top+'px'}, 1200);
});

That's it
Best regards
pixxelfactory

from jinvertscroll.

janbaykara avatar janbaykara commented on August 12, 2024

Is there a simple way to calculate (depending on screen, element sizes etc) the TOP value needed for these links? I've some automatically generated content and can't figure out how to translate % scroll to it.

from jinvertscroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.