Danke euch. Ich habe dies zu tun (es scheint funktioniert gut), mit Hilfe von diesem Artikel: http://jonraasch.com/blog/a-simple-jquery-slideshow
Mein Code:
<script type="text/javascript">
function slideSwitch() {
var $active = $('#slideshow li.active');
if ($active.length == 0) $active = $('#slideshow li:last');
var $next = $active.next().length ? $active.next() : $('#slideshow li:first');
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(document).ready(function() {
setInterval(slideSwitch, 5000);
});
</script>
Die CSS:
<style type="text/css">
ul {
position: relative;
}
#home {
background: url("1.jpg") center center no-repeat;
height:263px;
}
#web {
background: url("2.jpg") center center no-repeat;
height:263px;
}
#design {
background: url("3.jpg") center center no-repeat;
height:263px;
}
#event {
background: url("4.jpg") center center no-repeat;
height:263px;
}
#slideshow li {
position:absolute;
top:0;
left:0;
z-index:8;
opacity:0.0;
height: 263px;
width:100%;
}
#slideshow li.active {
z-index:10;
opacity:1.0;
}
#slideshow li.last-active {
z-index:9;
}
</style>
Und er HTML:
<div id="slideshow">
<ul>
<li id="home" class="active"></li>
<li id="event"></li>
<li id="web"></li>
<li id="design"></li>
</ul>
</div>
Es funktioniert gut, aber für den Moment verwende ich 960gs (und eine klebrige Fußzeile), und ich habe eine Menge Probleme: Die #slideshow muss in absoluten (ich muss es in der Mitte der Seite schieben), und wenn dies tun, ist es verschwinden :(.
Irgendwelche Hilfe? Thanx
Fab
Was jQuery Slideshow-Plugin verwenden Sie? Können Sie einen relevanten Code posten? –
Ja. (Es ist wirklich schwer zu helfen, ohne ein Stück Code zu sehen.) –