One slider works well, but if more then one works only last. Did somebody solve this problem?
One slider works well, but if more then one works only last. Did somebody solve this problem?
bag - 1. all ids are equal on a page, 2. All triggers have the same name So, some changes:
When define slides you should define unique id. I did it like this
$defs[]=array('slides'=>$slides,'flexsliderOptions'=>$options,'htmlOptions'=>array('id'=>'flexslider_'.$position.$i));
Changes in XFlexSlider.php
public function run() { ... if(!isset($this->htmlOptions['id'])) $this->htmlOptions['id']=$this->getId(); //$this->htmlOptions['id']=self::DEFAULT_SLIDER_ID; ... } ... public function registerClientScript() { ... //trigger the slider $cs->registerScript( 'flexslider_trigger_'.$this->htmlOptions['id'], ' $(window).load(function() { $(\'#' . $this->htmlOptions['id'] . '\').flexslider(' . $param . '); ' . $js_thumb . ' }); ', CClientScript::POS_END ); }
That’s work.