-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.html
210 lines (198 loc) · 9.57 KB
/
examples.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html>
<head>
<style>
body{
margin:0;padding:0;
}
</style>
</head>
<body>
<div id="pure-js-slideshow" class="pure-js-slideshow" >
<div class="pure-js-slideshow-container">
<div class="pure-js-slideshow-content" data-thumb="./images/1.jpg" >
<img src="./images/1.jpg" />
<div >
<h1>1st Content</h1>
<p>Positioned: Middle, Center</p>
<div ><button onclick="pure1.nextSlide()">Next</button></div>
</div>
</div>
<div class="pure-js-slideshow-content">
<img src="./images/2.jpg" data-thumb="./images/2.jpg" />
<div data-pos-v='bottom' data-pos-h='right'>
<h1>2nd Slide</h1>
<p>Positioned: Bottom, Right</p>
<div ><button onclick="pure1.previousSlide()">Previous</button> <button onclick="pure1.nextSlide()">Next</button></div>
</div>
</div>
<div class="pure-js-slideshow-content">
<img src="./images/3.jpg" data-thumb="./images/3.jpg" />
<div data-pos-v="top" data-pos-h="center">
<h1>3d Content</h1>
<p>Positioned: Top, Center</p>
<div><button onclick="pure1.lastSlide()">Take me to the End</button></div>
</div>
</div>
<div class="pure-js-slideshow-content">
<img src="./images/4.jpg" data-thumb="./images/4.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/5.jpg" data-thumb="./images/5.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/6.jpg" data-thumb="./images/6.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/7.jpg" data-thumb="./images/7.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/8.jpg" data-thumb="./images/8.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/9.jpg" data-thumb="./images/9.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/13.jpg" data-thumb="./images/13.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/10.jpg" data-thumb="./images/10.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/11.jpg" data-thumb="./images/11.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/14.jpg" data-thumb="./images/14.jpg" />
</div>
<div class="pure-js-slideshow-content">
<img src="./images/12.jpg" data-thumb="./images/12.jpg" />
</div>
</div>
</div>
<br />
<h3>API</h3>
<button onclick="pure1.firstSlide()">Move to 1st Content</button>
<button onclick="pure1.previousSlide()">Previous Content</button>
<button onclick="pure1.nextSlide()">Next Content</button>
<button onclick="pure1.lastSlide()">Move to Last Content</button>
<button onclick="alert(pure1.getCurrentIndex())">Get Current Index</button>
<button onclick="pure1.thumbsVisible(false)">Hide Thumbs</button>
<button onclick="pure1.thumbsVisible(true)">Show Thumbs</button>
<button onclick="is_playing=!is_playing;pure1.autoPlay(is_playing)">Pause/Start Auto Play</button>
<button onclick="pure1.fullScreen()">Full Screen</button>
<br />
<script src="./pure-js-slideshow.js"></script>
<script>
var is_playing = false;
var pure1 = null;
window.addEventListener('DOMContentLoaded',function(){
pure1 = new pure_js_slideshow(
{
el:'#pure-js-slideshow',
fullscreen:true,//defaults to false, shows icon for full screen
backgroundColor:'#000',
keyboard: true,//defaults to false, move slides with left and right arrows when element has focus
animation:'fade',
autoplay: is_playing,
dragContent: true,
imageRatio:1,//defaults to 0, show images with background-size: cover;
//imageRatio==1, show vertical images with background-size: auto 100%
//imageRatio==2, show all images with background-size: auto 100%;
mobile:{
enabled: false, //your custom login to detect if its mobile or not
maxheight: 750,
minheight: 600
},
timeout:3000,
transition:750,
//maxheight:490,
dynamicHeightResizer:function(me,winheight){
var win = window,
doc = document,
docElem = doc.documentElement,
body = doc.getElementsByTagName('body')[0];
var winwidth = win.innerWidth || docElem.clientWidth || body.clientWidth;
var height = winwidth * 78/100;
console.log('height',height)
height = winwidth * 0.66;
return height;
},
maxheightResizer:function(me,winheight){
var win = window,
doc = document,
docElem = doc.documentElement,
body = doc.getElementsByTagName('body')[0];
var winwidth = win.innerWidth || docElem.clientWidth || body.clientWidth;
var winheight2 = win.innerHeight || docElem.clientHeight || body.clientHeight;
var height = winwidth * 78/100;
console.log('h',height);
if(me.thumbHeight){
return winheight-me.thumbHeight
}
return winheight2;
},
//minheight:390,
dragCallback:function(instance,currentIndex, newIndex){
//newIndex might be undefined
//console.log(currentIndex,new Date());
},
inited:function(instance,currentIndex){
//console.log('plugin inited')
console.log(1280/1920);
},
animated:function(instance,currentIndex){
//console.log('animated',currentIndex);
},
thumbSelected:function(instance,currentIndex,imageSrc){
//console.log('thumb selected',imageSrc);
},
pageSelected:function(instance,currentIndex,imageSrc){
},
slideClicked:function(instance,currentIndex,imageSrc){
//console.log('slide clicked',imageSrc);
},
navigation:{
visible:true,
borderColor:'#fff',
backgroundColor:'transparent',
arrowColor:'#fff',
radius:'50%',//radius of arrows px or %
mobile:{
visible:true
}
},
pagination:{
visible:true,
borderColor:'#fff',
backgroundColor:'#fff',
size: 14,//defaults to 10
mobile:{
visible:true
}
},
thumbnails:{
visible:false,
borderColor:'#000000',
selectedBorderColor:'#ffffff',
width:90,
height: 70,
mobile:{
visible:true,
width:100,
height:80
}
}
}
)
})
</script>
</body>
</html>