Commit 9564e1bf authored by steffen.ritter's avatar steffen.ritter

ChangeBannerAnimation

git-svn-id: http://svn.t3o.typo3.org/extensions/projects/t3org/randombanners/trunk@2746 e8cb78a8-64f2-4011-8042-bd1ea5058d47
parent 831bbe07
......@@ -60,28 +60,28 @@ function initBanners() {
}
$('.gc .tx-randombanners:eq(0)').data('no', 0).oneTime((Math.PI + 1) * 1000 /* Why not? */, 'premiumbanner', rotateNext);
}
$(document).everyTime(5000,function(){
if($(".d.navigationbanners .tx-randombanners").length > 0) {
var first_shown = $(".d.navigationbanners #randombanners .shown:first").index(".tx-randombanners-item");
var last_shown = $(".d.navigationbanners #randombanners .shown:last").index(".tx-randombanners-item");
$(".d.navigationbanners #randombanners .shown").each(function(){
$(this).removeClass("shown").fadeOut("slow",function(){
if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item") && first_shown == 0){
$(".d.navigationbanners .tx-randombanners-item:eq(1), .d.navigationbanners .tx-randombanners-item:eq(2)").fadeIn("slow").addClass("shown");
}
else if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item")-1){
$(".d.navigationbanners .tx-randombanners-item:eq(0), .d.navigationbanners .tx-randombanners-item:last").fadeIn("slow").addClass("shown");
}
else if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item") && first_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item")-1){
$(".d.navigationbanners .tx-randombanners-item:first, .d.navigationbanners .tx-randombanners-item:eq(1)").fadeIn("slow").addClass("shown");
}
else{
$(".d.navigationbanners .tx-randombanners-item:eq("+(last_shown+1)+"), .d.navigationbanners .tx-randombanners-item:eq("+(last_shown+2)+")").fadeIn("slow").addClass("shown");
}
});
});
}
if($(".d.navigationbanners .tx-randombanners").length > 0) {
var first_shown = $(".d.navigationbanners #randombanners .shown:first").index(".tx-randombanners-item");
var last_shown = $(".d.navigationbanners #randombanners .shown:last").index(".tx-randombanners-item");
$(".d.navigationbanners #randombanners .shown").each(function(){
$(this).removeClass("shown").fadeOut("slow",function(){
if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item") && first_shown == 0){
$(".d.navigationbanners .tx-randombanners-item:eq(1), .d.navigationbanners .tx-randombanners-item:eq(2)").fadeIn("slow").addClass("shown");
}
else if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item")-1){
$(".d.navigationbanners .tx-randombanners-item:eq(0), .d.navigationbanners .tx-randombanners-item:last").fadeIn("slow").addClass("shown");
}
else if(last_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item") && first_shown == $(".d.navigationbanners .tx-randombanners-item:last").index(".tx-randombanners-item")-1){
$(".d.navigationbanners .tx-randombanners-item:first, .d.navigationbanners .tx-randombanners-item:eq(1)").fadeIn("slow").addClass("shown");
}
else{
$(".d.navigationbanners .tx-randombanners-item:eq("+(last_shown+1)+"), .d.navigationbanners .tx-randombanners-item:eq("+(last_shown+2)+")").fadeIn("slow").addClass("shown");
}
});
});
}
});
}
......@@ -90,5 +90,5 @@ $(document).ready(function() {
if ($('#randombanners')) {
initBanners();
}
});
\ No newline at end of file
......@@ -97,35 +97,19 @@ function clickBanner(el) {
}
function initBanners() {
var rotator = new BannerRotator("#randombanners");
/* platin members at the left navigation */
if($(".d.navigationbanners .tx-randombanners").length > 0) {
var container = $('#randombanners .tx-randombanners');
var banners = $(".d.navigationbanners .tx-randombanners-item");
var numBanners = banners.length;
for(var i=0; i< 4; i++) {
var banner = banners[Math.floor(Math.random() * numBanners)];
container.prepend(banner);
}
banners.each(function(){
if($(this).index() > 1)
$(this).css("display","none");
});
$(".d.navigationbanners .tx-randombanners-item:eq(0), .d.navigationbanners .tx-randombanners-item:eq(1)").addClass("shown");
}
/* platin members at the homepage */
if($(".gc .tx-randombanners").length > 0) {
rotator.containerCount = 2;
rotator.switchDelay = 0;
rotator.switchPause = 5000;
}
rotator.initialize();
}
$(document).ready(function() {
if ($('#randombanners')) {
initBanners();
var rotator = new BannerRotator("#randombanners");
rotator.initialize();
}
});
\ 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