Reputation: 65
I'm going crazy because I don't get the tinyscrollbar script working since 3 hours! I try to load it in a modal box but I can't figure out the of tinyscrollbar to update as soon as I open the modal box. I already tried many - not for me working - solution from around the web.
So the code inside the modal box looks like this:
<div class="et-place-main-text">
<div class="scrollbar"><div class="track"><div class="thumb"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<?php the_field('content_modal_box');?>
</div>
</div>
</div> <!-- .et-place-main-text -->
Now I need the correct code to kick tinyscrollbar_update();
as soon as someone opens the modal with this link #myModal-<? the_ID(); ?>
...
It would be great if someone has an idea.
Upvotes: 0
Views: 315
Reputation: 332
Trigger Your scrollbar on 'shown.bs.modal':
$('.modal').on('shown.bs.modal', function() {
scrollbar_init(); // trigger scrollbar after modal shown
});
Upvotes: 0