danielle (January 25th, 2012)
$distance_unit = 'mi' == get_option( 'cp_distance_unit', 'mi' ) ? 'mailia' : 'kilometriä';
// show the city/zip code field and radius slider bar
if ( array_key_exists(0, $locarray) || array_key_exists(1, $locarray) ) :
?>
<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(function($) {
$('#dist-slider').slider( {
range: 'min',
min: 0,
max: 300,
value: <?php echo esc_js( isset( $_POST['distance'] ) ? intval( $_POST['distance'] ) : '50' ); ?>,
step: 5,
slide: function(event, ui) {
$('#distance').val(ui.value + ' <?php echo $distance_unit; ?>');
}
});
$('#distance').val($('#dist-slider').slider('value') + ' <?php echo $distance_unit; ?>');
});
// ]]>
</script>
danielle (January 25th, 2012)
There are currently 1 users browsing this thread. (0 members and 1 guests)