I assume you are using the latest version of flexslider, in which case you can use setup (), which is more efficient. I also create a separate event to trigger the setup () function the first time I click the .toggle button.
Something like that:
$toggleButtons = $('#hotspots .toggle-button'); //execute once, then remove this event $toggleButtons.on('click.flexSetup', function() { $('.flexslider').data('flexslider').setup(); //remove this click event $toggleButtons.off('click.flexSetup'); }); //your regular click events $toggleButtons.on('click', function() { $("#hotspots .dropdown-area").slideToggle("slow"); $("#hotspots span").toggleClass("toggle-button close"); });
If you need a quick and dirty solution, you can simply use absolute positioning instead of hiding flexslider.
section#hotspots .dropdown-area { position: absolute; left: -10000px; }
And just set the position and left properties for the default css when you want to "show" flexslider. ( position: static and left: auto in your case)
source share