Answer the question
In order to leave comments, you need to log in
Boostrap scripts in tabs and slider loaded last?
Hey!
There are tabs on Boostrap4
Inside each tab there is a slider.
When the page is refreshed, the slider on the first tab loads and works normally.
And on the following tabs, the slider is displayed incorrectly until you move it with the cursor or until you open the browser inspector on it.
How to remove this error? Maybe it's a feature of Bootstrap?
Test Case
There is an example Tabs->Lightbox->Slider and Slider->Slider
Tried unsuccessfully:
1) Make the slider activation script load on page load.
Wrapped in
$(document).ready ( function(){ ... });
Either function funonload() { ... }
Either function funonload() { ...} window.onload = funonload;
2) I tried to use different sliders, I settled on Slick JS
3) I cleaned all the errors in the console, no result.
Answer the question
In order to leave comments, you need to log in
Have you seen that with every click of the slider, an error flies to the console?
Index.html:43 Uncaught TypeError: $(...).animate is not a function
at HTMLAnchorElement.<anonymous> (Index.html:43)
at HTMLAnchorElement.dispatch (
Most likely, the slider does not get the dimensions of its workspace, perhaps it is launched before the popup is opened.
When you pull it, it calculates everything, and when you open the inspector, the window is resized and recalculated in the same way.
As a possible solution - $(window).resize(), but this is a rake.
Watch errors in the console and profile events, and don't blindly poke code with wrappers and don't expect it to work...
All debugging is done ONLY step by step!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question