create slider dynamically

pull/6/head
Michael Keller 12 years ago
parent 8dfd1a1f3b
commit 58e9b839f2

@ -9,12 +9,11 @@
<link rel="stylesheet" href="../lib/cartodb.css">
<link rel="stylesheet" href="../css/jqueryui-smoothness/jquery-ui-1.10.2.custom.min.css">
<style>
#slider{
#torque-slider{
position:absolute;
top:5px;
right:25px;
width:300px;
display:none;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
@ -106,7 +105,6 @@
</head>
<body onload="initialize()">
<div id="map_canvas"></div>
<div id="slider"></div>
<div class="torque_time"></div>
<a class="cartodb_logo" href="http://www.cartodb.com" target="_blank">CartoDB</a>
</body>

@ -153,7 +153,8 @@ Torque.modules.layer = function (torque) {
if (this.options.scrub){
this.options.autoplay = false;
this.options.trails = false;
$("#slider").show();
$('body').append('<div id="torque-slider"></div>');
}
if (this.options.autoplay) {
@ -338,7 +339,7 @@ function init_slider( that ){
var that_opts = that.options;
// Init jQuery UI options
$("#slider").slider({
$("#torque-slider").slider({
min: Math.round(that_opts.start),
max: Math.round(that_opts.end),
value: Math.round(that_opts.start),

Loading…
Cancel
Save