-
Notifications
You must be signed in to change notification settings - Fork 68
/
sample.dynamicspeed.html
40 lines (39 loc) · 1.44 KB
/
sample.dynamicspeed.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="ddpanorama.css" />
<script type="text/javascript" src="jquery.1.7.1.min.js"> </script>
<script type="text/javascript" src="jquery.ba-outside-events.min.js"> </script>
<script type="text/javascript" src="imagesloaded.pkgd.min.js"> </script>
<script type="text/javascript" src="ddpanorama.min.js"> </script>
</head>
<body>
<img src="PanoSarek.jpg" alt="" />
<br />
<button id="left">left</button>
<button id="stop">stop</button>
<button id="right">right</button>
<script>
//see
jQuery(function(){
var moveSpeed=150;
jQuery("img").ddpanorama({ratio:9/16}).bind("ddredraw", function(event){
//do something here to handle redraw event
//event.speed contains a speed (px/sec)
//event.canvas contains a canvas element
//event.loaded contains a boolean flag which indicates whether the image is loaded or not
//(I'll add later more compelling examples later)
});
jQuery("#left").click(function(){
jQuery("img").ddpanorama({minSpeed:-moveSpeed});
});
jQuery("#stop").click(function(){
jQuery("img").ddpanorama({minSpeed:0});
});
jQuery("#right").click(function(){
jQuery("img").ddpanorama({minSpeed:moveSpeed});
});
});
</script>
</body>
</html>