php - Insert image instead of dots navigation in image slider using jquery -
i want insert image navigation instead of dots navigation in image slide. script doesn't work. want set class='cbp-fwcurrent'
inside <img>
tag, happens outsite. how can this?
code:
index.php
<div class="gallery"> <ul> <li> <div class="image_block"> <a href=""> <img src="<?php echo $one_data['image_name'];?>" border="0" alt="sponcer<?php echo $banner_cnt;?>" style="margin-bottom: 20px;" /> </a> </div> </li> </ul> </div>
js
if(this.itemscount > 1) { // add navigation arrows (the previous arrow not shown initially): this.$navprev = $('<span class="cbp-fwprev"><</span>').hide(); this.$navnext = $('<span class="cbp-fwnext">></span>'); $('<nav/>').append(this.$navprev, this.$navnext).appendto(this.$el); // add navigation dots var dots = ''; for( var = 0; < this.itemscount; ++i ) { // current dot have class cbp-fwcurrent var dot = === this.current ? '<img class="cbp-fwcurrent"></img>' : '<img></img>'; dots += dot; } //var navdots = $('.gallery ul li .image_block img ').append(dots).appendto(this.$el); var navdots = $('<div class="gallery"><ul><li><div class="image_block"><a>').append(dots).appendto(this.$el); this.$navdots = navdots.children('img'); }
Comments
Post a Comment