Using jQ (displaying the slider value)

22 views
Skip to first unread message

atk

unread,
Apr 11, 2014, 8:28:02 PM4/11/14
to wub-dis...@googlegroups.com
Hi All,
I want to display the value of my range slider as the slider is dragged.
I do not know jquery at all but with the help of jQ i can easily create any
of the UIs. However, how event driven code is written using jQ is still unclear to me.

My slider was created as follows;
set r [jQ slider $r "#sldrrange" range true min 0 max 20000 step 5 animate true values \[1000,10000\]]

The highlighted/bold part below (if visible to you) is what am trying to do.

Below is a sample jquery code from jqueryui.com of exactly what I want to achieve;
<script>
$(function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 75, 300 ],
slide: function( event, ui ) {
$( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] );
}
});
$( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) +
" - $" + $( "#slider-range" ).slider( "values", 1 ) );
});

</script>

Thanks

Colin McCormack

unread,
Apr 11, 2014, 8:35:07 PM4/11/14
to wub-dis...@googlegroups.com

The slide element is just another element, its content,  from the pov of tcl and jQ is just text, that it happens to be interpreted by the browser as a function is not relevant.

So ... wrap your text in {} and pass it through as you're passing the rest through.

Colin

--
You received this message because you are subscribed to the Google Groups "Wub Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wub-discussio...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages