SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2013
    Location
    Baguio City, Philippines
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Blogger problem: Inserting jQuery scrollTop in Blogger HTML not working

    I am having problems making jQuery scripts work on my Blogger blog. [ It works on other platforms such as in Tumblr and also works on jsFiddle and Codepen ]. But, for some reason, I can't get it to work on Blogger Blogspot blog.

    Here's the code:

    HTML Code:
    <style>
    #scrollfooter {
        position:fixed;
        left:0px;
        bottom:0px;
        height:100px;
        width:100%;
        display:none;
    }
    </style>
    <div id="scrollfooter">Contents here will not be visible on top of the page, but will appear when scrolled down 200px.</div>
    <script type='text/javascript'>
    $(window).scroll(function() {
        if ($(this).scrollTop() < 200) {
            $("#scrollfooter").hide();
        }
        else {
            $("#scrollfooter").show();
        }
    });
    </script>
    I tried using this for the javascript:

    HTML Code:
    <script type='text/javascript'>
        //<![CDATA[
    $(window).scroll(function() {
        if ($(this).scrollTop() < 200) {
            $("#scrollfooter").hide();
        }
        else {
            $("#scrollfooter").show();
        }
    });
    </script>
    ... but to no avail. I have tried putting the code in Blogger gadget, which gained me nothing.

    Your big help would be so much appreciated. Thanks SitePoint, members and staff!

  2. #2
    SitePoint Enthusiast
    Join Date
    Oct 2012
    Location
    Tinker Air Force Base, Oklahoma, United States
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gotta ask the obvious: Have you loaded jQuery, and does it come before the script you're running?


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •