Fix Ad_Banner

This commit is contained in:
Manson Wang committed 2013-10-08 17:35:46 +08:00
1 parent 74fe25ab28
commit 665c01c8b8
2 files changed
+19 -7

No files matched your search

+15 -5
View File
@@ -19,7 +19,12 @@ function ajax_load_proc(wapper,url,isBanner){
if (textSta == 'success') {
if(isBanner=="true"){
wapper.html(respText);
BannerCycle();
var banner = banners[banner_index];
$(banner.banner_name+" > img").each(function(){
$(this).load(function(){ banner.image_loaded++; });
});
BannerCycle(banner_index);
banner_index++;
}else{
wapper.html(respText);
}
@@ -29,10 +34,10 @@ function ajax_load_proc(wapper,url,isBanner){
});
}
function BannerCycle(){
function BannerCycle(banner_index){
var banner = banners[banner_index];
banner_index++;
$.getScript('/static/jquery.cycle.all.latest.js', function(){
// $.getScript('/static/jquery.cycle.all.latest.js', function(){
if (!!$.prototype.cycle && (banner.image_loaded==banner.image_count)){
$(banner.banner_name).ready(function() {
$(banner.banner_name).cycle({
delay: -1000,
@@ -42,7 +47,12 @@ function BannerCycle(){
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
});
});
});
}else{
// console.log("Waiting");
$.getScript('/static/jquery.cycle.all.latest.js');
setTimeout("BannerCycle("+banner_index+")",500);
}
// });
}
// Ad Banner FX code [start]