Fix Ad_Banner Image loading bug
This commit is contained in:
1 parent
35733da7ba
commit
3b0dc9cd50
2 files changed
+18
-9
No files matched your search
+13
-6
@@ -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,9 @@ 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(){
|
||||
if (!!$.prototype.cycle && (banner.image_loaded==$(banner.banner_name+" img").length)){
|
||||
$(banner.banner_name).ready(function() {
|
||||
$(banner.banner_name).cycle({
|
||||
delay: -1000,
|
||||
@@ -42,7 +46,10 @@ function BannerCycle(){
|
||||
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
|
||||
});
|
||||
});
|
||||
});
|
||||
}else{
|
||||
if(!$.prototype.cycle) $.getScript('/static/jquery.cycle.all.latest.js');
|
||||
setTimeout("BannerCycle("+banner_index+")",500);
|
||||
}
|
||||
}
|
||||
|
||||
// Ad Banner FX code [start]
|
||||
@@ -66,4 +73,4 @@ $(document).ready(function() {
|
||||
}
|
||||
})
|
||||
});
|
||||
// Ad Banner FX code [end]
|
||||
// Ad Banner FX code [end]
|
||||
Reference in new issue
Block a user