Forums

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

Home Forums JavaScript Internet Explorer Won't load custom scrollbar after google's custom search

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #147244
    roostaamir
    Participant

    I am using nicescroll jquery plugin in my website.And I am also using google’s custom search on my search page.The custom search has a result-only interface and I am showing the search result’s in a div element

    nicescroll works this way that if the page needs a scrollbar,it will show one.And if the page doesn’t need a scrollbar,it won’t show the scrollbar.

    I am using a script tag in my masterpage to call jquery and nicescrolll libraries,and I am using a script tag in my search page to load google’s custom search scripts.

    The problem is that in IE,(as google’s custom search takes some time to load the results)the scrollbar won’t appear(I think it is because at first the page doesn’t need a scrollbar,since the results of the search haven’t been shown yet!But even after the results show up,there is still no scroll bar in IE).And I noticed if I resize the IE window and then back to its original size,the scroll bar WILL appear.Here are my codes:

    //these scripts load in my master page(since I need the scrollbar for my other pages)
    <script type="text/javascript" src="/Scripts/jquery-1.7.1.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.nicescroll.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
            $("html").niceScroll();
            } 
        );
    </script> 
    
    //this script loads in my search.aspx page where I want the search results to appear
    <script type="text/javascript">
        $(document).ready(function () {
            (function () {
                var cx = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
                var gcse = document.createElement('script');
                gcse.type = 'text/javascript';
                gcse.async = true;
                gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
                    '//www.google.com/cse/cse.js?cx=' + cx;
                var s = document.getElementsByTagName('script')[0];
                s.parentNode.insertBefore(gcse, s);
            })();
        });
    
    //and here's how I am showing the results
    <div id="searchWrapper">
        <gcse:searchresults-only></gcse:searchresults-only>
    </div>
    

    As you can see,I even tried putting the nicescroll script in window.load event since it will occur after document.ready.But still the problem exists!!

    ps:My search page is working fine on chrome and firefox.I only have this problem with IE.

    Any ideas about my problem?

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