Forums

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

Home Forums JavaScript jquery not working in project

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #41532
    wragen22
    Member

    Hi folks,
    I have a very rough expand function here through jquery that works in codepend, however I’m having trouble getting it to work in my project. I’m using codekit with an normal setup of index.html, css.scss, script.js. Codekit is recognizing the file, but chrome inspector is showing a red arrow on the 3rd row… with
    “Uncaught TypeError: Cannot set property ‘scrollTop’ of null”

    http://codepen.io/joe/full/rmeat

    Any help is appreciated.

    #118635
    chrisburton
    Participant

    @wragen22

    Edit: This may be a stupid question but some usually forget, are you calling jQuery in your page?

    #118637
    wragen22
    Member

    yes, buddy of mine we’re exploring some designs. Yes jquery is being called.

    #118639
    chrisburton
    Participant

    @wragen22 I can’t seem to replicate the issue. Are there other jQuery scripts that could be conflicting with this?

    #118641
    wragen22
    Member

    Hmm.. none others. Perhaps i’m calling it wrong?

    Have this in my header

    #118644
    chrisburton
    Participant

    @wragen22 create a new pen on codepen so I can see what you’re talking about.

    I noticed that when I add the jquery in the head section, it doesn’t work but if I add it just before the closing body tag, it does.

    #118646
    wragen22
    Member
    #118647
    chrisburton
    Participant

    @wraggen22, No I mean post the exact code you have in your html page (you can remove the links so no one knows the URL). It doesn’t matter if it renders or not, I just want to see how you have it structured.

    #118649
    wragen22
    Member

    Interesting… posted my html i have in my project to the codpen and js is not rendering.

    Here is the updated codepen.

    http://codepen.io/wragen22/full/sqrlD

    #118651
    chrisburton
    Participant

    @wragen22 That’s how CodePen works. You only paste your content that’s inside the body element. But I needed that to see how you’re doing things.

    Try removing this from your head section and placing it right before you closing body tag (< /body >).


    #118653
    wragen22
    Member

    That works! … now why would that be the case?

    #118654
    chrisburton
    Participant

    @wragen22 I think it has to do with the way it loads the page. I hope this solved your issue. If not, we can troubleshoot further.

    #118656
    wragen22
    Member

    It did. Might you be able to recommend a cleaner type of js expand though? Not really liking how the text slides in from the left as the panel expands.

    #118661
    chrisburton
    Participant

    As in an accordion style expand? http://jqueryui.com/accordion/

    #118665
    wragen22
    Member

    hmmm…for some reason the current js I have when clicking to close – the background color disappears then slides up.

    I’m trying to get to a model like this here. Where you click – expands nicely and closes when others are clicked.

    http://www.mdlwebsolutions.com/blog/milo-lamar/jquery-animated-sliding-or-fading-hidden-elements

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