Hi Manmade,
it's not online.
This is the full code example for the gallery used in my project.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,
user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<title>Gallery</title>
<script type="text/javascript" src="../src/swipeview.js"></script>
<style>
html, body { height:100%; }
body {
padding:0;
margin:0;
background:#000;
-webkit-user-select:none;
-webkit-text-size-adjust:none;
color:#000;
font-family:helvetica;
font-size:12px;
}
#wrapper {
width:100%;
min-width:320px;
height:100%;
}
#counter {
position:absolute;
z-index:100;
bottom:7px;
width:100%;
height:26px;
/*left:50%;*/
text-align:center;
color:#FFFFFF;
font-family:helvetica;
font-size:18px;
}
#nav {
position:absolute;
z-index:100;
bottom:8px;
width:200px;
height:20px;
left:50%;
/*background:rgba(0,0,0,0.75);*/
padding:0;
margin:0 0 0 -100px;
-webkit-border-radius:10px;
}
#nav li {
display:block;
float:left;
width:10px;
height:20px; line-height:14px;
-webkit-border-radius:7px;
background:rgba(255,255,255,0.5);
overflow:hidden;
padding:0;
margin:3px 11px 0 0;
text-align:center;
}
#nav li#prev {
margin-left:5px;
background:transparent;
}
#nav li#next {
margin-right:0;
background:transparent;
}
#nav li.selected {
background:rgba(255,255,255,0.4);
}
#swipeview-slider > div {
position:relative;
display:-webkit-box;
-webkit-box-orient:vertical;
-webkit-box-pack:center;
-webkit-box-align:center;
overflow:hidden;
}
#swipeview-slider img {
display:block;
/*border:1px solid #eee;*/
/*-webkit-box-shadow:0 2px 6px #000;
-webkit-border-radius:1px;*/
-webkit-transition-duration:.4s;
-webkit-transition-property:opacity;
opacity:1;
pointer-events:none;
}
/*#swipeview-slider span {
position:absolute;
bottom:0;
left:0;
width:100%;
padding:20px 0;
display:block;
background:rgba(0,0,0,0.75);
font-size:20px;
text-align:center;
text-shadow:0 1px 0 #000;
border-top:1px solid rgba(255,255,255,0.2);
-webkit-border-top-left-radius:10px;
-webkit-border-top-right-radius:10px;
-webkit-transition-duration:.3s;
-webkit-transition-property:-webkit-transform;
-webkit-transform:translate3d(0,100%,0);
}
#swipeview-slider .swipeview-active span {
-webkit-transform:translate3d(0,0,0);
}*/
#wrapper > div > .swipeview-loading {
background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#444),
to(#555)),
-webkit-gradient(linear, 0 0, 100% 0, from(#777), to(#777));
background-position:50% 50%, 50% 50%;
background-size:200px 140px, 210px 150px;
background-repeat:no-repeat;
}
#wrapper > div > .swipeview-loading img,
#swipeview-slider img.loading {
-webkit-transition-duration:0;
opacity:0;
}
#wrapper > div > .swipeview-loading span {
-webkit-transition-duration:0;
-webkit-transform:translate3d(0,100%,0);
}
.footer {
-webkit-box-sizing: border-box;
border-bottom: 1px solid #000;
padding: 10px;
height: 44px;
background: url(toolbar.png) #000000 repeat-x;
position:absolute;
bottom:0;
left:0;
width:100%;
}
</style>
</head>
<body>
<div id="wrapper"></div>
<div id="counter"></div>
<script type="text/javascript">
document.addEventListener('touchmove', function (e)
{ e.preventDefault(); }, false);
var gallery,
el,
i,
page,
dots = document.querySelectorAll('#nav li'),
slides = [
{
img: 'gallery/1.jpg',
width: 1024,
height: 768,
desc: ''
},
{
img: 'gallery/2.jpg',
width: 1024,
height: 768,
desc: ''
}
];
</script>
<script type="text/javascript">
gallery = new SwipeView('#wrapper', { numberOfPages:
slides.length,loop: false });
document.getElementById('counter').innerHTML = "1 / "+slides.length;
// Load initial data
for (i=0; i<3; i++) {
page = i==0 ? slides.length-1 : i-1;
el = document.createElement('img');
el.className = 'loading';
el.src = slides[page].img;
el.width = slides[page].width;
el.height = slides[page].height;
el.onload = function () { this.className = ''; }
gallery.masterPages[i].appendChild(el);
el = document.createElement('span');
//el.innerHTML = slides[page].desc;
gallery.masterPages[i].appendChild(el)
}
gallery.onFlip(function () {
var el,
upcoming,
i;
for (i=0; i<3; i++) {
upcoming = gallery.masterPages[i].dataset.upcomingPageIndex;
if (upcoming != gallery.masterPages[i].dataset.pageIndex) {
el = gallery.masterPages[i].querySelector('img');
el.className = 'loading';
el.src = slides[upcoming].img;
el.width = slides[upcoming].width;
el.height = slides[upcoming].height;
el = gallery.masterPages[i].querySelector('span');
//el.innerHTML = slides[upcoming].desc;
}
document.getElementById('counter').innerHTML = (gallery.pageIndex
+1)+" / "+slides.length;
}
document.querySelector('#nav .selected').className = '';
dots[gallery.pageIndex+1].className = 'selected';
});
gallery.onMoveOut(function () {
//gallery.masterPages[gallery.currentMasterPage].className =
gallery.masterPages[gallery.currentMasterPage].className.replace(/(^|
\s)swipeview-active(\s|$)/, '');');
});
gallery.onMoveIn(function () {
//var className =
gallery.masterPages[gallery.currentMasterPage].className;
///(^|\s)swipeview-active(\s|$)/.test(className) ||
(gallery.masterPages[gallery.currentMasterPage].className = !
className ? 'swipeview-active' : className + ' swipeview-active');
});
</script>
<div class="footer"></div>
</body>
</html>
> > M- Nascondi testo citato