How to loop through carousel banner slider, when i embed the foreach loop, the slider did not show very well.The slider images are not displaying very well. These are the code below.I will appreciate your contribution on the topic Thank you
" Live=""> filename); $bannerUrl = $resultObj->prefix."wbanners/".$resultObj->filename; $bannerType = ""; if($resultObj->bannerType != 'video' && $resultObj->bannerType != 'channel' && $resultObj->bannerType != 'channels' && $resultObj->bannerType != 'category'){ $bannerType = 'tunes'; } if($resultObj->bannerType == 'video'){ $bType = base64_encode($resultObj->contentID); $bannerType = 'video'; //echo $bType; exit; $live = $resultObj->isLive; } if($resultObj->bannerType == 'channels' || $resultObj->bannerType == 'channel'){ $bT = $resultObj->contentID; $cID = ""; $bannerType = 'channel'; $cQuery = $this->db->query("select cat_id from channels where id = '$bT'"); if($cQuery->num_rows() > 0){ $c = $cQuery->row(); $cID = $c->cat_id; } $bType = $bT.'/'.$cID; } if($resultObj->bannerType == 'category'){ $bType = base64_encode($resultObj->contentID); $live = $resultObj->isLive; $bannerType = 'category'; } if(in_array(strtolower($resultObj->bannerType),array('tunes_track','tunes_album'))){ $bType = base64_encode($resultObj->contentID); $live = $resultObj->isLive; $bannerType = 'tunes'; } ?> " class="banner" width="748" height="260" alt="Experience Barcelona" title="Experience Barcelona">
<style type="text/css" scoped>
#slider{
background-color:#282828;
background-repeat:repeat;background-size: initial;
}
</style>
<script type='text/javascript' src='http://ift.tt/2cLm13q'></script>
<script type='text/javascript' src='http://ift.tt/2dlcXQ7'></script>
<script type="text/javascript">
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("mySlides");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 5000); // Change image every 5 seconds
}
</script>
Aucun commentaire:
Enregistrer un commentaire