Execute multiple owl carousel on one page with php -


i have owl carousel in 1 section pulls images php code.

<?php $count = get_option( 'posts_per_page' );   the_widget( 'post_widget1', 'count='.$count.'&orderby=date' ); ?> 

i trying display carousel using same code again little different settings set in post_widget2 code looks like:

<section class="vbox"> <section class="scrollable padder-lg">  <h4>new</h4><hr />  <?php  $count = get_option( 'posts_per_page' ); the_widget( 'post_widget1', 'count='.$count.'&orderby=name' ); ?>  </section> </section>   <section class="vbox"> <section class="scrollable padder-lg">  <h4>new</h4><hr />  <?php  $count = get_option( 'posts_per_page' ); the_widget( 'post_widget2', 'count='.$count.'&orderby=date' ); ?>  </section> </section>    <script src="owl-carousel/jquery-1.9.1.min.js"></script>  <script src="owl-carousel/owl.carousel.js"></script>   <script> $(document).ready(function() {    var owl = $("#owl-demo");   var owl = $("#owl-demo2");     owl.owlcarousel({    items : 5, //10 items above 1000px browser width   navigation : false,   pagination : false,   responsive : true,   autoplay : true,   navigationtext : ["<",">"]   });    $(".next").click(function(){   owl.trigger('owl.next');   })   $(".prev").click(function(){   owl.trigger('owl.prev'); })  }); </script> 

the carousel display once. realised because php script executed once, question how can work twice on same page?

at first glance looks problem javascript not php:

var owl = $("#owl-demo"); var owl = $("#owl-demo2"); 

you're using same variable name, overwrites first one.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -