Note that there are some explanatory texts on larger screens.

plurals
  1. POAction-dependant Javascript/Jquery - how to activate a command only AFTER another script has finished?
    primarykey
    data
    text
    <p>I'm working on my website and I decided it would be to my advantage to use 'designed' scroll bars instead of the ones browsers come with. I was lucky enough to come across this script <a href="http://www.hesido.com/web.php?page=customscrollbar" rel="nofollow">http://www.hesido.com/web.php?page=customscrollbar</a> which basically does exactly what I need.</p> <p>The only problem I've got is that I am trying to apply the custom scrollbars to some divs which are initially hidden and then toggle via a link div between hide/show. As the programming page (http://www.hesido.com/flexcroll/flexcroll-programming.htm) explains, sometimes the scrollbar needs to be updated and/or manually applied, because being in hidden divs they do not load when the page opens.</p> <p>I've checked my CSS and my HTML and the code works fine if the div is not hidden, so I am 100% that this has to do with the way I am hiding my divs.</p> <p>The basic format for that is</p> <p><code>$(document).ready(function() { $('#iddiv').hide();}); </p> <pre><code>$(document).ready(function() { $('#id').click(function() { $('#iddiv').animate({ height: 'toggle' }, 2000 ); });}); </code></pre> <p></code></p> <p>So I hide it initially, and then toggle it via a button. Now, in this logic - the manual application of <code>fleXenv.fleXcrollMain("your-div-id");</code> should be somewhere above the last line of script (the one containing }); ).</p> <p>This, however, either makes the div unscrollable or messes up the rest of my Javascript (scrollTo functions stop working, etc...)</p> <p><strong>My question is, as a bit of a noobie JS user - WHERE do I need to place that piece of code that manually activates the custom scrollbar in my code AFTER the toggle is activate and WHAT is the structure?</strong> By which I mean, does <code>fleXenv.fleXcrollMain("your-div-id");</code> stand on its own, does it need its own separate function, does it get a $ before it?</p> <p>Loads of thanks to anyone who can help me with this! Final bit stopping me from launching my website.</p> <p>UPDATE! <a href="http://jsfiddle.net/KDe3M/" rel="nofollow">HERE</a> is the CSS/HTML and code for an example of what I am trying to achieve; because one of the files in the script needs to be downloaded to work, I think the only way is to copy and paste all the bits in a new HTML document.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload