par
hakazizi » 08 janv. 2015, 15:22
bonjour nouveau problème
la première version de mon slide (marginLeft: XX) présentait un défaut au niveau visuel au retour en arrière
j'ai donc essayer hide(slide) et show(slide) dans Jqueryui.
le problème qui se présente :
après le hide de la première photo un long temps vide. puis affichage des 2 premières photos sans arrêt intermédiaire la troisième ne s'affiche jamais.
dans la version final je ne sait pas combien de photo cela peut varier d'une page à l'autre.
merci.
visible à l'url ci dessous:
http://fr.larosedelorient.com/slider.php
et voici le code utilisé
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html>
<head>
<title>slider</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
* {margin:0;padding0;}
.photo {
position:relative;
width: 1170px;
height: 640px;
overflow: hidden;
background-color:#777777;margin-left:auto;margin-right:auto;
}
.photo ul {
/* 3 images donc 3 x 100% */
width: 300%;
height: 100%;
padding:0; margin:0;
list-style: none;
}
.photo li {
float: left;
}
img.slider{margin-left:345px;margin-right:345px}
img.slider1{margin-left:345px;margin-right:345px}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script type="text/javascript">
$(function(){
var refreshIntervalId = setInterval(function(){
$(".photo ul li").hide("slide",{direction:"left"},500, /* li cacher */ function(){
$(this).next('li').show("slide",{direction:"right"},500); /* li suivante afficher */
});
find("li:last").after($(".photo ul").find("li:first"));
}, 5000);
/* $('.precsuiv').on('click', function(e) { */
/* e.preventDefault(e); */
/* clearInterval(refreshIntervalId); */ /* On arrete le setInterval */
/* var _width = $(this).attr('data-width'); */
/* $(".photo ul").animate({marginLeft: _width},800,function(){ */
/* $(this).css({marginLeft:0}).find("li:last").after($(this).find("li:first")); */
/* }); */
/* refreshIntervalId = setInterval(function(){ */
/* $(".photo ul").animate({marginLeft:-1170},800,function(){ */
/* $(this).css({marginLeft:0}).find("li:last").after($(this).find("li:first")); */
/* }) */
/* }, 5000); */
/* }); */
});
</script>
</head>
<body>
<div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div><div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div><div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div><div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div>
<div id="photo" class="photo">
<span data-width="-1170" class="precsuiv" style="background: url(images/fleche-gauche.gif) no-repeat 10px center;width:345px;height:100%;position:absolute;z-index:2;cursor:pointer;"></span>
<ul id="ul_photo">
<li><img class="slider" src="images/1.jpg" title="" alt="" /></li>
<li><img class="slider" src="images/2.jpg" title="" alt="" /></li>
<li><img class="slider" src="images/3.jpg" title="" alt="" /></li>
</ul>
<span data-width="1170" class="precsuiv" style="background: url(images/fleche-droite.gif) no-repeat 323px center;width:345px;height:100%;position:absolute;top:0;right:0;z-index:2;cursor:pointer;"></span>
</div>
</body>
</html>
P.S. J'ai voulu changé le titre pour le mettre en rapport avec le problème actuel je ne sait pas comment faire...
bonjour nouveau problème
la première version de mon slide (marginLeft: XX) présentait un défaut au niveau visuel au retour en arrière
j'ai donc essayer hide(slide) et show(slide) dans Jqueryui.
le problème qui se présente :
après le hide de la première photo un long temps vide. puis affichage des 2 premières photos sans arrêt intermédiaire la troisième ne s'affiche jamais.
dans la version final je ne sait pas combien de photo cela peut varier d'une page à l'autre.
merci.
visible à l'url ci dessous:
http://fr.larosedelorient.com/slider.php
et voici le code utilisé
[php]<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">
<html>
<head>
<title>slider</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
* {margin:0;padding0;}
.photo {
position:relative;
width: 1170px;
height: 640px;
overflow: hidden;
background-color:#777777;margin-left:auto;margin-right:auto;
}
.photo ul {
/* 3 images donc 3 x 100% */
width: 300%;
height: 100%;
padding:0; margin:0;
list-style: none;
}
.photo li {
float: left;
}
img.slider{margin-left:345px;margin-right:345px}
img.slider1{margin-left:345px;margin-right:345px}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css" />
<script type="text/javascript">
$(function(){
var refreshIntervalId = setInterval(function(){
$(".photo ul li").hide("slide",{direction:"left"},500, /* li cacher */ function(){
$(this).next('li').show("slide",{direction:"right"},500); /* li suivante afficher */
});
find("li:last").after($(".photo ul").find("li:first"));
}, 5000);
/* $('.precsuiv').on('click', function(e) { */
/* e.preventDefault(e); */
/* clearInterval(refreshIntervalId); */ /* On arrete le setInterval */
/* var _width = $(this).attr('data-width'); */
/* $(".photo ul").animate({marginLeft: _width},800,function(){ */
/* $(this).css({marginLeft:0}).find("li:last").after($(this).find("li:first")); */
/* }); */
/* refreshIntervalId = setInterval(function(){ */
/* $(".photo ul").animate({marginLeft:-1170},800,function(){ */
/* $(this).css({marginLeft:0}).find("li:last").after($(this).find("li:first")); */
/* }) */
/* }, 5000); */
/* }); */
});
</script>
</head>
<body>
<div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div><div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div><div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div><div>lkbfnlkbfkllkklkklflkmlfflkùldflùfkbnlnblkrl,klf,lk,flklbklk,blfd</div>
<div id="photo" class="photo">
<span data-width="-1170" class="precsuiv" style="background: url(images/fleche-gauche.gif) no-repeat 10px center;width:345px;height:100%;position:absolute;z-index:2;cursor:pointer;"></span>
<ul id="ul_photo">
<li><img class="slider" src="images/1.jpg" title="" alt="" /></li>
<li><img class="slider" src="images/2.jpg" title="" alt="" /></li>
<li><img class="slider" src="images/3.jpg" title="" alt="" /></li>
</ul>
<span data-width="1170" class="precsuiv" style="background: url(images/fleche-droite.gif) no-repeat 323px center;width:345px;height:100%;position:absolute;top:0;right:0;z-index:2;cursor:pointer;"></span>
</div>
</body>
</html>[/php]
P.S. J'ai voulu changé le titre pour le mettre en rapport avec le problème actuel je ne sait pas comment faire...