i'm trying to implement clone select menu using the following plugin:
https://github.com/afEkenholm/ScrollectBox
https://github.com/afEkenholm/ScrollectBox/blob/master/index.html
https://github.com/afEkenholm/ScrollectBox/blob/master/js/ScrollectBox/jquery.scrollectbox.js
but i'm unable to get the option value of select menu. it returns option text instead.
how to get the value (but not text) of an option in the following select menu onChange
using jquery call function?
<script type="text/javascript">
jQuery(document).ready(function($){
$(".selection").scrollectBox({
preset: 'dropdown',
numVisibleOptions: 4,
scrollInterval: 150,
scrollOn: 'hover'
});
});
<select onchange="function(this);" id="selector" class="selection" >
<option value="" selected="Select Topic">Select Topic</option>
<option value="Food">Food</option>
<option value="Drink">Drink</option>
</select>
thanks,
RE-EDIT:
Doesn't work
<script type="text/javascript">
jQuery(document).ready(function($){
var selectEvent = function($el){
someFunction($(this).val());
return false;
};
$(".selection").scrollectBox({
preset: 'dropdown',
numVisibleOptions: 4,
onSelectEvent: selectEvent,
scrollInterval: 150,
scrollOn: 'hover'
});
});
</script>
it returns [object Object]
Doesn't work
<script type="text/javascript">
jQuery(document).ready(function($){
$(".selection").scrollectBox({
preset: 'dropdown',
numVisibleOptions: 4,
scrollInterval: 150,
scrollOn: 'hover',
onSelectEvent: function (item, event) {
alert(item).val();
}
});
});
</script>
it returns [object Object]