| Autor | Zpráva | ||
|---|---|---|---|
| trta Profil |
#1 · Zasláno: 26. 4. 2010, 13:34:44
Ahoj snažím se přijít na to, jak přes php "vybrat" obrázky určitého adresáře a ty následně zobrazit pomocí javascriptu na stránce jako jednoduchou slideshow. Jde mi jen o přeblikávací obrázky bez jakýchkoliv tlačítek. Poradíte prosím, jak na to, nebo alespoň nějaké zdroje?
Děkuji |
||
| Mar Profil |
#2 · Zasláno: 26. 4. 2010, 20:47:36
já to mám takto:
<script type="text/javascript">
function slideSwitch() {
var $active = $('#slideshow IMG.active');
if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
// use this to pull the images in the order they appear in the markup
var $next = $active.next().length ? $active.next()
: $('#slideshow IMG:first');
// uncomment the 3 lines below to pull the images in random order
// var $sibs = $active.siblings();
// var rndNum = Math.floor(Math.random() * $sibs.length );
// var $next = $( $sibs[ rndNum ] );
$active.addClass('last-active');
$next.css({opacity: 0.0})
.addClass('active')
.animate({opacity: 1.0}, 1000, function() {
$active.removeClass('active last-active');
});
}
$(function() {
setInterval( "slideSwitch()", 7000 );
});
</script>
<style type="text/css">
/*** set the width and height to match your images **/
#slideshow {
position:relative;
height:220px;
margin-top:3px;
}
#slideshow IMG {
position:absolute;
top:0;
left:0;
z-index:8;
opacity:0.0;
max-height: 216px;
}
#slideshow IMG.active {
z-index:10;
opacity:1.0;
}
#slideshow IMG.last-active {
z-index:9;
}
</style>
<div id="slideshow"> <center> <img style="Cursor:Pointer;" title="Fotka 2229" src="adresanaobrázek1" alt="Slideshow Image 1" class="active" /> <img style="Cursor:Pointer;" title="Fotka 2229" src="adresanaobrázek2" alt="Slideshow Image 1"/> </center> </div> stačí si v php udělat nějaký výpis souborů z adresáře a poté dosazovat, co si klient vybral na slide-show, pokud můžu něco doporučit, používej databázi(tabulky) a budeš 100% vědět, kde máš uložený obrázek, co je to za obrázek, atd..............procházení adresářů(e)se mi nelíbí |
||
|
Časová prodleva: 16 let
|
|||
0