Napisałem prosty skrypcik - slider tekstu na stronie.
Mam jedyny problem, którego nie udaje mi się rozwiązać otóż zanim pojawi się napis mam przez chwilę samo zielone tło z cieńszym paskiem.
Jak zrobić aby od razu pojawił się pierwszy napis na zielonym tle, a nie cieńszy zielony pasek bez napisu?
Zielony pasek ze sliderem nałożyłem na duże zdjęcie znajdujące się na środku.
http://www.migrapolis.pl/pl/
Kod html
Kod .js
$(document).ready(function() { $('.sd-buttons a').click(function(){ switch_tabs($(this)); }); switch_tabs($('.defaulttab')); }); function switch_tabs(obj) { $('.tab-content').hide(); var id = obj.attr("rel"); $('#'+id).fadeIn(1000); $('#'+id).show("slow"); } $(document).ready(function() { var i = 1; var last_visible = 1; var number = $('#tabs').children().size() setInterval(function() { if(i == number) { i = 1; last_visible = number; } else{ last_visible = i; i++; } $('#tabs'+last_visible).fadeOut('slow', function(){$('#tabs'+i).fadeIn('slow')}); }, 3000); });
.tab-content { display: none; padding-top: 7px; color: #ffffff; font-size: 100%; } .sd-buttons { list-style: none; font-weight: bold; font-size: 11px; } ul.sd-buttons li { display: inline; width: 21px; height: 21px; background: #000; padding: 10px; } ul.sd-buttons li a { color: #fff; } #slider { z-index: 100; position: absolute; top: 48%; left: 31%; right: 31%; font-size: 140%; color: #ffffff; text-align: center; font-weight: normal; opacity:0.8; padding:15px; background-color:#9CC342; }