Commit e8566430 authored by tolleiv.nietsch's avatar tolleiv.nietsch

make sure the premium banners look really really really nice

git-svn-id: http://svn.t3o.typo3.org/extensions/projects/t3org/randombanners/trunk@1701 e8cb78a8-64f2-4011-8042-bd1ea5058d47
parent 2d7fa976
......@@ -12,7 +12,8 @@ plugin.tx_randombanners {
}
}
[globalVar = TSFE:id = ${const.page.root}]
# Ideally taken from ${const.page.root}
[globalVar = TSFE:id = 3]
plugin.tx_randombanners.settings.numberOfBannersShown = -1
[global]
......
......@@ -24,6 +24,9 @@ $(document).ready(function() {
}
/* platin members at the homepage */
if($(".gc .tx-randombanners").length > 0) {
for(var banneri = 0; banneri < 4; banneri++) {
banner_position_array[banneri] = banneri;
}
for(var bannerfields = 0; bannerfields < 3; bannerfields++)
$(".gc .tx-randombanners:eq(0)").clone().insertAfter(".tx-randombanners:eq(0)");
......@@ -36,10 +39,23 @@ $(document).ready(function() {
$(".gc .tx-randombanners-item").each(function(){
$(this).css("display","none");
});
$(".gc .tx-randombanners:eq(0) .tx-randombanners-item:eq(0), .gc .tx-randombanners:eq(1) .tx-randombanners-item:eq(1), .gc .tx-randombanners:eq(2) .tx-randombanners-item:eq(2), .gc .tx-randombanners:eq(3) .tx-randombanners-item:eq(3)").addClass("shown").fadeIn("slow");
}
for(var banneri = 0; banneri < 4; banneri++)
banner_position_array[banneri] = banneri;
$(".gc .tx-randombanners:eq(0) .tx-randombanners-item:eq(0), .gc .tx-randombanners:eq(1) .tx-randombanners-item:eq(1), .gc .tx-randombanners:eq(2) .tx-randombanners-item:eq(2), .gc .tx-randombanners:eq(3) .tx-randombanners-item:eq(3)").addClass("shown").fadeIn("slow", function() {
});
banner_amount = $(".gc .tx-randombanners:first .tx-randombanners-item").length;
var rotateNext = function() {
var banneri = $(this).data('no');
var next = (banneri + 1)%4;
current_banner = banner_position_array[banneri];
new_banner = banner_position_array[banneri] = (banner_position_array[banneri]-1+banner_amount)%banner_amount;
$(".banner"+banneri+":eq("+current_banner+")").data('banners', {banneri: banneri, new_banner: new_banner}).fadeOut("slow", function() {
$(".banner"+$(this).data('banners').banneri+":eq("+$(this).data('banners').new_banner+")").fadeIn("slow", function() { $(this).addClass("shown")});
});
$('.gc .tx-randombanners:eq(' + next + ')').data('no', next).oneTime('1s', 'premiumbanner', rotateNext);
}
$('.gc .tx-randombanners:eq(0)').data('no', 0).oneTime('1s', 'premiumbanner', rotateNext);
}
}
});
}
......@@ -64,15 +80,5 @@ $(document).ready(function() {
});
});
}
if($(".gc .tx-randombanners").length > 0) {
banner_amount = $(".gc .tx-randombanners:first .tx-randombanners-item").length;
for(var banneri = 0; banneri < 4; banneri++){
current_banner = banner_position_array[banneri];
new_banner = banner_position_array[banneri] = (banner_position_array[banneri]+1)%banner_amount;
$(".banner"+banneri+":eq("+current_banner+")").data('banners', {banneri: banneri, new_banner: new_banner}).fadeOut("slow", function() {
$(".banner"+$(this).data('banners').banneri+":eq("+$(this).data('banners').new_banner+")").fadeIn("slow", function() { $(this).addClass("shown")});
});
}
}
});
});
});
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment