Ad_Banner fix for FGU
This commit is contained in:
1 parent
3b0dc9cd50
commit
56ef57cdd8
3 files changed
+48
-9
No files matched your search
+42
-6
@@ -1,5 +1,7 @@
|
||||
var banners = [];
|
||||
var banner_index = 0;
|
||||
$q = jQuery;
|
||||
$q.getScript('/static/jquery.cycle.all.latest.js');
|
||||
|
||||
$(document).ready(function() {
|
||||
$.each($(".dymanic_load"),function(){
|
||||
@@ -36,22 +38,56 @@ function ajax_load_proc(wapper,url,isBanner){
|
||||
|
||||
function BannerCycle(banner_index){
|
||||
var banner = banners[banner_index];
|
||||
if (!!$.prototype.cycle && (banner.image_loaded==$(banner.banner_name+" img").length)){
|
||||
$(banner.banner_name).ready(function() {
|
||||
$(banner.banner_name).cycle({
|
||||
if (banner.image_loaded==$(banner.banner_name+" img").length){
|
||||
if(banner.banner_name=="#slideshow-banner"){
|
||||
$q(banner.banner_name).cycle({
|
||||
delay: -1000,
|
||||
fx: banner.banner_fx,
|
||||
timeoutFn: getTimeout,
|
||||
timeout: banner.time_to_next,
|
||||
pager: banner.banner_pager,
|
||||
pagerAnchorBuilder: function(idx, slide) { return "<li><a href='#'></a></li>"; }
|
||||
});
|
||||
});
|
||||
}else{
|
||||
var width = banner.best_size.split(" x ")[0];
|
||||
var height = banner.best_size.split(" x ")[1];
|
||||
$(banner.banner_name).css( "width", width);
|
||||
$(banner.banner_name).css( "height", height);
|
||||
$(banner.banner_name).css( "display", "block");
|
||||
$(banner.banner_name).css( "overflow", "hidden");
|
||||
$(banner.banner_name+" > img").each(function(){
|
||||
$( this ).css( "position", "absolute" );
|
||||
$( this ).css( "top", "0" );
|
||||
$( this ).css( "left", "0" );
|
||||
$( this ).css( "display", "block" );
|
||||
});
|
||||
if($(banner.banner_name+" > img").length>1) OrbitCycle(banner_index);
|
||||
}
|
||||
}else{
|
||||
if(!$.prototype.cycle) $.getScript('/static/jquery.cycle.all.latest.js');
|
||||
setTimeout("BannerCycle("+banner_index+")",500);
|
||||
}
|
||||
}
|
||||
|
||||
function OrbitCycle(banner_index){
|
||||
var banner = banners[banner_index];
|
||||
var index = 0;
|
||||
|
||||
$(banner.banner_name+" > img").each(function(){
|
||||
if(index==banner.current){
|
||||
$(this).fadeTo( "slow" , 1);
|
||||
}else{
|
||||
$(this).fadeTo( "slow" , 0);
|
||||
}
|
||||
index++;
|
||||
});
|
||||
if((banner.current+1)<$(banner.banner_name+" img").length){
|
||||
banner.current++;
|
||||
}else{
|
||||
banner.current=0;
|
||||
}
|
||||
// console.log("OrbitCycle: "+banner_index);
|
||||
setTimeout("OrbitCycle("+banner_index+")",banner.time_to_next);
|
||||
}
|
||||
|
||||
// Ad Banner FX code [start]
|
||||
function getTimeout() {
|
||||
return $(this).attr('time_to_next');
|
||||
|
||||
Reference in new issue
Block a user