• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Add jquery to Genesis Sample Theme

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Add jquery to Genesis Sample Theme

This topic is: not resolved

Tagged: jquery, synchronized sidebar

  • This topic has 3 replies, 2 voices, and was last updated 8 years, 4 months ago by kolbigray.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 15, 2014 at 10:15 am #131609
    kolbigray
    Member

    Hey there! SO I have a quick question. IF you go over to http://jsfiddle.net/VdNPs/ and look at how the sidebar and content are synchronized when the page scrolls up and down so that the content reaches the bottom of the page at the same time, I was wondering how I would put this code into my blog.

    The code she uses is

    var d1 = document.getElementById('div1'),
        d2 = document.getElementById('div2');
    
    function s() {
     
     var p = (d1.scrollHeight - d1.clientHeight) / d1.scrollTop,
         x = (d2.scrollHeight - d2.clientHeight) / p;
     
     d2.scrollTop = Math.round(x);
        
    }
    
    d1.onscroll = s;

    but when I try putting this in my blog (after changing the divs) it doesn't work right. Is there something i'm doing wrong?

    Thanks for your help!

    http://www.lifewithkolbi.com
    November 15, 2014 at 12:55 pm #131623
    JamesRoberts
    Member

    Hi, how are you adding this code to your site?


    Need beautiful and responsive Genesis child themes at amazing prices? Stop by LlamaPress and check out our themes.

    November 15, 2014 at 1:13 pm #131627
    kolbigray
    Member

    Hey there James! here is what I added to my site.

    <script>
    
    var d1 = document.getElementById('content'),
        d2 = document.getElementById('sidebar-stuff');
    
    function s() {
     
     var p = (d1.scrollHeight - d1.clientHeight) / d1.scrollTop,
         x = (d2.scrollHeight - d2.clientHeight) / p;
     
     d2.scrollTop = Math.round(x);
        
    }
    
    d1.onscroll = s;
    
    </script>
    

    I know I'm probably doing something wrong.

    November 15, 2014 at 1:14 pm #131628
    kolbigray
    Member

    I also added this to the top of the sidebar widget code. I don't know If I've used the right divs. I really wanted to use the VariScroll.js script, but I couldn't figure it out either. Thanks for your help bud.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble