Salve,
ho realizzato una fotogallery di immagini che scorrono cliccando sulle freccine. PErò su Internet Explorer non funziona.
Questo il codice presente nella pagina html:
Codice PHP:
<div class="gallery_pallavicini">
<div id="binder">
<div class="prev"></div>
<ul class="list">
[*][img]images/item/abitazioni/1.jpg[/img][*][img]images/item/abitazioni/2.jpg[/img][*][img]images/item/abitazioni/3.jpg[/img][*][img]images/item/abitazioni/4.jpg[/img][*][img]images/item/abitazioni/5.jpg[/img][*][img]images/item/abitazioni/6.jpg[/img][*][img]images/item/abitazioni/7.jpg[/img][*][img]images/item/abitazioni/8.jpg[/img][*][img]images/item/abitazioni/9.jpg[/img][*][img]images/item/abitazioni/10.jpg[/img][*][img]images/item/abitazioni/11.jpg[/img][*][img]images/item/abitazioni/12.jpg[/img][*][img]images/item/abitazioni/13.jpg[/img][*][img]images/item/abitazioni/14.jpg[/img][*][img]images/item/abitazioni/15.jpg[/img][*][img]images/item/abitazioni/16.jpg[/img]
[/list]
<div class="next"></div>
</div>
<script>!window.jQuery && document.write(unescape('%3Cscript src="script/jquery-1.6.4.min.js"%3E%3C/script%3E'))</script>
<script src="script/script.js"></script>
</div>
</div>
Questo il foglio di stile collegato alla gallery:
Codice PHP:
@import url([url]http://fonts.googleapis.com/css?family=Raleway[/url]);
#binder {
display: block;
width: 850px;
vertical-align: top;
overflow: hidden;
margin-right: auto;
margin-left: auto;
}
.list {
display: inline-block;
list-style-type: none;
margin: 0;
width: 100000px;
text-align: left;
}
.list li {
display: inline-block;
width: 380px;
margin: 2.2em 1.4em;
position: relative;
vertical-align: bottom;
}
.next, .prev {
position: absolute;
width: 35px;
height: 35px;
cursor: pointer;
border-radius: 5px;
}
.next {
top: 400px;
margin-left: 840px;
background: url('../images/next.png') center center no-repeat;
}
.next:hover {
background: rgba(255,255,255,0.3) url('../images/next.png') center center no-repeat;
}
.prev {
top: 390px;
margin-left: -40px;
background: url('../images/prev.png') center center no-repeat;
}
.prev:hover {
background: rgba(255,255,255,0.3) url('../images/prev.png') center center no-repeat;
}
.footer {
color: #584b2b;
font-size: 14px;
}
[B]E questo lo script js:[B/]
Codice PHP:
$(document).ready(function() {
$('.prev').css("background-image" , "none");
//Initialize
onMoving = false;
item = $('.list li');
itemReverse = item.get().reverse();
itemSize = item.size();
itemDisplayed = 6;
itemToSlide = itemDisplayed * 9;
currentSlide = 1;
page = Math.round(itemSize/itemDisplayed);
//Next button clicked
$('.next').click(function() {
if(currentSlide >= 7) {
$(this).css("background-image" , "none");
}
if(currentSlide >= 1) {
$('.prev').css("background-image" , "url('images/prev.png')");
}
if(onMoving || currentSlide >= 8)
return false;
onMoving = true, currentSlide++;
$.each(item, function() {
var i = $(this).index();
var delay = i * 100;
window.setTimeout(function (index) {
return function () {
item.eq(index).stop().animate({ 'right' : '+='+itemToSlide+'em' }, function() {
if(index >= itemSize-1) onMoving = false;
});
};
} (i), delay);
});
});
//Previous button clicked
$('.prev').click(function() {
if(currentSlide <= 8) {
$('.next').css("background-image" , "url('images/next.png')");
}
if(currentSlide <= 2) {
$(this).css("background-image" , "none");
}
if(onMoving || currentSlide == 1) return false;
onMoving = true, currentSlide--;
$.each(itemReverse, function() {
var i = $(this).index();
var delay = i * 100;
window.setTimeout(function (index) {
return function () {
$(itemReverse).eq(index).stop().animate({ 'right' : '-='+itemToSlide+'em' }, function() {
if(index >= 0) onMoving = false;
});
};
} (i), delay);
});
});
});