Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Problem porting Codepen to local machine.

  • This topic is empty.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #185373
    nixnerd
    Participant

    Guys, I’m trying to build on this Codepen locally:

    http://codepen.io/grayghostvisuals/pen/enxAp

    I’m copying the code exactly. Works fine… save for the fact that it’s INSANELY jumpy. If I put the pen on Full Page mode and put my local version right beside it… the local version looks like garbage and the one on Codepen looks smooth as butter. Same duration and everything. Not really sure why this is happening.

    Any thoughts?

    #185374
    nixnerd
    Participant

    Obviously both are in the same browser. I think that goes without saying but I just thought I’d throw that out there.

    #185377
    nixnerd
    Participant

    Found the problem… but haven’t figured it out. What I mean is… it makes no sense to me.

    Here’s what my scripts looked like:

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.13.2/TweenMax.min.js"></script>
    <script src="js/jquery.scrollmagic.min.js"></script>

    Here’s what they look like now (working well):

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.13.2/TweenMax.min.js"></script>
    <script src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/392/jquery.scrollmagic.min.js"></script>

    Did you catch that? Only difference is pulling ScrollMagic from Amazon… instead of locally?? How can this possibly work better? Seems to defy the laws of physics.

    I think this is a question for @traq or @jacobpeters.

    #185379
    nixnerd
    Participant

    Probably not the same exact code… which is weird. I’ll do a vimdiff later and see. Or maybe just a quick checksum… but that won’t teach me anything.

    #185380
    nixnerd
    Participant

    @Jerba… it was as if the scrolling wasn’t smooth at all. One click on the scroll wheel would equal like 400px. Super lame. Anyway, I found the problem… should probably let Jan Paepke know his download files are bad. The hosted libraries work MUCH better. It’s VERY noticeable.

    #185397
    __
    Participant

    Different scrollmagic versions would be my first guess as well. Second would be that you had the CDN version cached and your local file wasn’t, but that shouldn’t have caused any problems once it was done loading.

    … should probably let Jan Paepke know his download files are bad.

    So they were different? are we talking different versions, or a corrupted download?

    #185398
    nixnerd
    Participant

    I doubt it’s a corrupted download but it’s hard to say. I haven’t done a diff on them yet. But… I’d like to see what the difference is because the downloaded version had HORRIBLE performance… something I’ve NEVER experienced with Scroll Magic.

    #185425
    Alen
    Participant

    Did you do Javascript profiling to see where the issue is? What frame rate are you hitting?

    #185430
    __
    Participant

    I doubt it’s a corrupted download but it’s hard to say.

    When I wrote that, the word I was actually looking for was “bad build.”

    #185431
    nixnerd
    Participant

    No, never did. I just fixed it and moved on because I needed to get something wire-framed out. Didn’t look into it much more than that. How would I go about doing that Alen?

    #185452
    Alen
    Participant

    Just open up chrome dev tools and hit record on the profiler then just scroll around and look at the graph.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.