-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage_slider2.html
119 lines (84 loc) · 2.38 KB
/
page_slider2.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Slider - Snap to increments</title>
<link rel="stylesheet" href="jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
<script type="text/javascript" language="Javascript" SRC="./citeJB.js"></script>
<script type="text/javascript" language="Javascript" SRC="./cite_obj_interface2.js"></script>
<style type="text/css">
#slider { width: 500px;}
html,body
{
margin:0;
padding:0;
height:100%;
width:100%;
}
</style>
<script type="text/javascript">
setUpObj();
</script>
<script>
mouseDown = 0;
$(function() {
$( "#slider" ).slider({
value:1,
min: 1,
max: 500,
step: 1,
slide: function( event, ui ) {
$( "#amount" ).val( ui.value );
document.getElementById('amount2').innerHTML = ui.value;
//to get position of sliding thing
x=$("a.ui-slider-handle").position();
theTop = x.top;
theLeft = x.left;
y = $("#slider").position();
theTop = theTop + y.top + "px";
theLeft = theLeft + y.left + "px";
$('#amount2').css( {
'position': 'absolute',
'top': theTop, //worse problem
'left': theLeft, //worse problem
'z-index': 1000,
'font-size': 12,
'text-align': 'center'
});
//document.getElementById('positioning').innerHTML = "Top: " + theTop + " Left: " + theLeft ;
}
});
$( "#amount" ).val( $( "#slider" ).slider( "value" ) );
$( "#amount2" ).val( $( "#slider" ).slider( "value" ) );
//x=$("#slider").position();
//document.getElementById('positioning').innerHTML = "Top: " + x.top + " Left: " + x.left ;
});
function checkMouseUp ()
{
if(mouseDown == 1)
{
changeFlag(0);
GoToPage(Number(amount.value));
}
}
function changeFlag(value)
{
mouseDown = value;
}
</script>
</head>
<body onmouseup="checkMouseUp();">
<p>
<label for="amount">Page numbers:</label>
<input type="text" id="amount" style="border: 0; color: #f6931f; font-weight: bold;" />
</p>
<div id="amount2"></div>
<div id="slider" onmousedown="changeFlag(1);"></div>
<div id="target"></div>
<div id="original">
<img id="mainDisplay" src="Chad_Cover_Image.jpg" alt="Computerman" width="500" height="750" opacity="1";>
</div>
</body>
</html>