I am using the newest flexslider from Woothemes, and I am trying to init one flexslider inside another. Like this:
function initFrontpageSliders() {
$('#flexsliderFrontpage01').flexslider({
animation: "slide",
animationLoop: false,
pauseOnHover: true,
start: function(slider) {
//Fires when the slider loads the first slide
$('#flexsliderFrontpage02').flexslider({
animation: "fade",
directionNav: false,
animationLoop: false,
pauseOnHover: true
});
}
});
}
but when I call the script, is generates flexsliderFrontpage02 ul below flexsliderFrontpage01 and not inside the slide (list element) - like this:
<div id="flexsliderFrontpage01" class="flexslider">
<div class="flex-viewport">
<ul class="slides">
<li>
<div class="row">
<div id="flexsliderFrontpage02" class="flexslider"> SLIDES SHOULD BE HERE </div>
</div>
</li>
<li>
<div class="row">slide 2</div>
</li>
</ul>
<ul class="slides">
<li><div class="row">fade 1</div></li>
<li><div class="row">fade 2</div></li>
<li><div class="row">fade 3</div></li>
</ul>
</div>
<ol class="flex-control-nav flex-control-paging">
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
</ol>
<ul class="flex-direction-nav"> </ul>
</div>
Do any of you know if theres an easy fix to flexslider.js or am I doing something wrong ? :-)
my HTML looks like this:
<div class="flexslider" id="flexsliderFrontpage01">
<ul class="slides">
<li>
<div class="row">
<div class="flexslider" id="flexsliderFrontpage02">
<ul class="slides">
<li><div class="row">fade div 1</div></li>
<li><div class="row">fade div 2</div></li>
<li><div class="row">fade div 3</div></li>
</ul>
</div>
</div>
</li>
<li>
<div class="row">
<h1>This is slide 2</h1>
</div>
</li>
</ul>
</div>
I have solved it by using this example here:
Flexslider.js update
slider.container = $(slider.containerSelector, slider).first(); //added .first()
selector: ".slides:first > li", //added :first
Maybe this can help someone else :-)