Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS and Flexroll conflict

    Id like to control scrolling of two divs with one scrollbar as in this example here

    http://www.byenshjemmesider.dk/

    At the same time i want to customize the scrollbar. Ive been using Flexcroll which work fine on a single div. But as soon as i insert flexcroll.js to head of document in the example, the sync of the two divs breaks and only the div with Flexcroll attached scrolls.

    Anyone know how to solve this? You can find the code im using in the example or i can post.

    I dont have to use Flexcroll, so if you know of any other application that can customize scrollbar and control scroll on two divs at the same time, id appreciate a link.

  • #2
    New Coder
    Join Date
    Oct 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Tried jScrollPane instead of Flexcroll. Same issue, the sync between divs breaks..

    Any suggestions?

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,696
    Thanks
    25
    Thanked 658 Times in 657 Posts
    conflicts normally arise when the function names are the same. Check that or just change the ones you use. I just put a name in front of them like 'sam_' so
    function easyRider() becomes function sam_easyRider().

  • #4
    Senior Coder Logic Ali's Avatar
    Join Date
    Sep 2010
    Location
    London
    Posts
    1,028
    Thanks
    0
    Thanked 207 Times in 202 Posts
    Flexscroll changes the HTML structure around the div, which means you're no longer actually scrolling the same div.
    Last edited by Logic Ali; 10-10-2011 at 07:49 PM.

  • #5
    New Coder
    Join Date
    Oct 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thx for responses. Solved issue by using jscrollpane and this code in head:

    <script type="text/javascript">
    $(function()
    {
    $("#div2").bind('jsp-scroll-y', function(event, scrollPositionY) {
    $("#div1").scrollTop(scrollPositionY);
    }).jScrollPane();
    $("#document").jScrollPane();
    });
    </script>
    Last edited by henry hayes; 10-12-2011 at 02:57 PM.


  •  

    Posting Permissions

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