I am trying to implement a clone selection 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 cannot get the value of the select menu option. instead, it returns the option text.
how to get the value (but not the text) of an option in the next onChange selection menu using the 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:
Does not 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]
Does not 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]