开发者

Jquery Photogallery

开发者 https://www.devze.com 2023-03-31 10:50 出处:网络
I am using following Jquery code f开发者_运维百科or SlideShow <head> <title>Simple Slide Show with jQuery</title>

I am using following Jquery code f开发者_运维百科or SlideShow

<head>
<title>Simple Slide Show with jQuery</title>
<script type='text/javascript' 
src='http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js'>
</script>
<script type="text/javascript">
    var imgs = [
    'images/photo_1.jpg',
    'images/photo_2.jpg',
    'images/photo_3.jpg'];
    var cnt = imgs.length;

    $(function() {
        setInterval(Slider, 5000);
    });

    function Slider() {
    $('#imageSlide').fadeOut("slow", function() {
        $(this).attr('src', imgs[(imgs.length++) % cnt]).fadeIn("slow");
    });
    }
</script>
</head>
<body>
    <img id="imageSlide" alt="" src="" />

</body>
</html>

I have all all images named like photo_1.jpg, photo_2.jpg and soon.. i am not sure that how many images will be there in the directory.

What i want to know is what code changes should i do so that

1) The jpgs are displayed automatically from that folder ( the image name will be always photo_number.jpg , number will be starting from 1,2,3.. and soon.

2) The slideshow should stop if there is no image available.

Is this possible ?

3) I dont want to use any Server Side Programming


i did the same thing you ask but with php (server side programming) i dont think it can be done without it.. i have a page who generate automatically albums from folders who contain images and make them in gallery array and also get the album name and date and view all this in albums array in a different page.. if you'ed like this ask for it i'd love to help..

0

精彩评论

暂无评论...
验证码 换一张
取 消