Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:02:50+00:00 2026-05-31T10:02:50+00:00

I am using jScrollPane for a simple website because I decided to go with

  • 0

I am using jScrollPane for a simple website because I decided to go with a centered, fixed div with height of 600px. Everything works fine except when I added facebook comment, the scrollable dive does not wait for facebook comment block to load, so the comment box is not viewable!

I am calling the function to the scroll script inside the HEAD tag:

        <script type="text/javascript" id="sourcecode">
        $(function()
        {
            $('.scroll-pane').jScrollPane();
        });
       </script>

And here is the scripto the facebook comment box that is inserted immideatly after BODY tag:

        <div id="fb-root"></div>
    <script>(function(d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        }(document, 'script', 'facebook-jssdk'));</script>

And here is the CSS that defines style for my scrollable DIV:

.scroll-pane
{
    width: 100%;
    height: 600px; 
    overflow: auto; 
}

As I said, the scrolled div works fine, But I think I should somehow make it to wait for that facebook comment box to load. Any suggestion is appriciated!

UPDATE

I found here that the scrolled div can check for dynamic content: dynamic content, but I have no idea where to put the follwoing code in my html file:

$(function()
{
    var settings = {
        showArrows: true
    };
    var pane = $('.scroll-pane')
    pane.jScrollPane(settings);
    var api = pane.data('jsp');
    var i = 1;
)};
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:02:52+00:00Added an answer on May 31, 2026 at 10:02 am

    Waiting for the fb comment box to be ready is not that easy, but you can a) wait for a fixed time and initialize the jScrollPane then, hoping that the fb box is ready by that time (like 1 or 2 seconds).

    <script type="text/javascript" id="sourcecode">
    $(function() {                        // <-- Wait for the DOM to be ready
        setTimeout(function() {
            // Now initialize the pane as before:
            $('.scroll-pane').jScrollPane();
        }, 1000);                         // <-- Waiting an additional 1000ms
    });
    </script>
    

    Or b) if you want to got with the example for dynamic content (from that link you provided), you would just reinitialize the jScrollPane every 100ms or whatever:

    <script type="text/javascript" id="sourcecode">
    $(function() {
        // As you already did, initialize the scrollpane first:
        var pane = $('.scroll-pane');
        pane.jScrollPane();
    
        // Store an access handler (api) in a variable
        var api = pane.data('jsp');
    
        // Set timer to reinitialize the pane every 250ms
        setInterval(api.reinitialise, 250);
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jScrollPane to scroll a div. Currently the default is to click
I have scrollbars using the jScrollPane plug-in for jQuery. The scrollbar works, all content
Is there a method of detecting whther website has been resized? I'm using jscrollpane
i just started using double buffering and everything worked just fine until i wanted
I've tried using jScrollPane on a <div> container of a <ul> element that I
I'm using the JQuery plugin jScrollPane I'm intialising it as follows.. It works initially
I have and issue with scrolling content of a jScrollPane div using the mousewheel,
I'm using jScrollPane, simply because it was the first thing on Google and I'm
I have a resizable div which is using custom scrollbars of jScrollPane. I want
I have embedded a JTextArea on a JScrollPane and am using that JTextArea for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.