AW: image slider gesucht
hallöle,
schaue mal bitte das ist der htmlcode, die pfade hatte ich zu den bildern doch so angegeben, eventuell die src= ....angabe!
HTML:
<ul class="slideshow">
<li class="show">
<a href="http://www.noa-noa-wuerzburg.de/shop/templates/UrzustandJTL-Shop3-Tiny/themes/custom/images/slider/bild1.gif"><img alt="bild1" height="350" src="images/slider/bild1.gif" title="Slide 1" width="675" /></a></li>
<li>
<a href="http://www.noa-noa-wuerzburg.de/shop/templates/UrzustandJTL-Shop3-Tiny/themes/custom/images/slider/bild2.gif"><img alt="bild2" height="350" src="images/slider/bild2.gif" title="Slide 2" width="675" /></a></li>
<li>
<a href="http://www.noa-noa-wuerzburg.de/shop/templates/UrzustandJTL-Shop3-Tiny/themes/custom/images/slider/bild3.gif"><img alt="bild3" height="350" src="images/slider/bild3.gif" title="Slide 3" width="675" /></a></li>
</ul>
hier der css
Code:
body {
font-family:arial;
font-size:12px;
}
ul.slideshow {
list-style:none;
width:675px;
height:350px;
overflow:hidden;
position:relative;
margin:0;
padding:0;
}
ul.slideshow li {
position:absolute;
left:0;
right:0;
}
ul.slideshow li.show {
z-index:500;
}
ul img {
border:none;
}
#slideshow-caption {
width:675px;
height:70px;
position:absolute;
bottom:0;
left:0;
color:#fff;
background:#000;
z-index:500;
}
#slideshow-caption .slideshow-caption-container {
padding:5px 10px;
z-index:1000;
}
#slideshow-caption h3 {
margin:0;
padding:0;
font-size:14px;
}
#slideshow-caption p {
margin:5px 0 0 0;
padding:0;
}
hier der JQ java:
1. $(document).ready(function() {
2.
3. //Execute the slideShow, set 4 seconds for each images
4. slideShow(2000);
5.
6. });
7.
8. function slideShow(speed) {
9.
10.
11. //append a LI item to the UL list for displaying caption
12. $('ul.slideshow').append('<li id="slideshow-caption" class="caption"><div class="slideshow-caption-container"><h3></h3><p></p></div></li>');
13.
14. //Set the opacity of all images to 0
15. $('ul.slideshow li').css({opacity: 0.0});
16.
17. //Get the first image and display it (set it to full opacity)
18. $('ul.slideshow li:first').css({opacity: 1.0});
19.
20. //Get the caption of the first image from REL attribute and display it
21. $('#slideshow-caption h3').html($('ul.slideshow a:first').find('img').attr('title'));
22. $('#slideshow-caption p').html($('ul.slideshow a:first').find('img').attr('alt'));
23.
24. //Display the caption
25. $('#slideshow-caption').css({opacity: 0.7, bottom:0});
26.
27. //Call the gallery function to run the slideshow
28. var timer = setInterval('gallery()',speed);
29.
30. //pause the slideshow on mouse over
31. $('ul.slideshow').hover(
32. function () {
33. clearInterval(timer);
34. },
35. function () {
36. timer = setInterval('gallery()',speed);
37. }
38. );
39.
40. }
41.
42. function gallery() {
43.
44.
45. //if no IMGs have the show class, grab the first image
46. var current = ($('ul.slideshow li.show')? $('ul.slideshow li.show') : $('#ul.slideshow li:first'));
47.
48. //Get next image, if it reached the end of the slideshow, rotate it back to the first image
49. var next = ((current.next().length) ? ((current.next().attr('id') == 'slideshow-caption')? $('ul.slideshow li:first') :current.next()) : $('ul.slideshow li:first'));
50.
51. //Get next image caption
52. var title = next.find('img').attr('title');
53. var desc = next.find('img').attr('alt');
54.
55. //Set the fade in effect for the next image, show class has higher z-index
56. next.css({opacity: 0.0}).addClass('show').animate({opacity: 1.0}, 1000);
57.
58. //Hide the caption first, and then set and display the caption
59. $('#slideshow-caption').slideToggle(300, function () {
60. $('#slideshow-caption h3').html(title);
61. $('#slideshow-caption p').html(desc);
62. $('#slideshow-caption').slideToggle(500);
63. });
64.
65. //Hide the current image
66. current.animate({opacity: 0.0}, 1000).removeClass('show');
67.
68. }