Reputation: 175
the code below doesn't seem to be working. What am I missing here?
<script type="text/javascript" language="javascript">
//disables scrolling on mouse over of <select> elements
$(document).ready(function() {
$('select').each(function() {
$(this).attr('onmousewheel', 'return false;');
});
});
</script>
Upvotes: 0
Views: 1958
Reputation: 389
onmousewheel is not really a attribute of SELECT HTML Element. See http://www.w3schools.com/tags/tag_select.asp
You are trying to set Mouse event. http://www.w3schools.com/tags/ref_eventattributes.asp
You can achieve this in the way MISJHA pointed.
Upvotes: 1
Reputation: 1008
You can try this:
<script type="text/javascript" language="javascript">
//disables scrolling on mouse over of <select> elements
$(document).ready(function() {
$('select').each(function() {
$(this).on('mousewheel', function(){
return false;
});
});
});
</script>
Upvotes: 2