Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var nearest = 0;
- if ( 0 != options.firstRollerId.length && 0 != options.secondRollerId.length )
- {
- if ( 0 != options.sliderMinValue )
- {
- $('#' + options.firstRollerId).find('option').each(function(i)
- {
- if ( parseInt( jQuery(this).text() ) < parseInt( options.sliderMinValue ) )
- {
- nearest = parseInt( jQuery(this).attr('value') );
- }
- else if ( parseInt( jQuery(this).text() ) > parseInt( options.sliderMinValue ) )
- {
- settings.sliderOptions.min = nearest;
- $('#' + options.firstRollerId).find('option').eq(nearest).attr( 'selected', 'selected' );
- nearest = 0;
- return false;
- }
- else
- {
- settings.sliderOptions.min = parseInt( jQuery(this).attr('value') );
- jQuery(this).attr( 'selected', 'selected' );
- nearest = 0;
- return false;
- }
- });
- }
- if ( 0 != options.sliderMaxValue )
- {
- $('#' + options.secondRollerId).find('option').each(function(i)
- {
- if ( parseInt( jQuery(this).text() ) < parseInt( options.sliderMaxValue ) )
- {
- nearest = parseInt( jQuery(this).attr('value') );
- }
- else if ( parseInt( jQuery(this).text() ) > parseInt( options.sliderMaxValue ) )
- {
- settings.sliderOptions.max = nearest;
- $('#' + options.secondRollerId).find('option').eq(nearest).attr( 'selected', 'selected' );
- nearest = 0;
- return false;
- }
- else
- {
- settings.sliderOptions.max = parseInt( jQuery(this).attr('value') );
- jQuery(this).attr( 'selected', 'selected' );
- nearest = 0;
- return false;
- }
- });
- }
- //$('#' + options.firstRollerId).find('option').eq(options.sliderOptions.min).attr( 'selected', 'selected' );
- //$('#' + options.secondRollerId).find('option').eq(options.sliderOptions.max).attr( 'selected', 'selected' );
- }
Add Comment
Please, Sign In to add comment