Monday, June 05, 2006

Reign in the track wheel in IE

I work on a lot of ASPX pages and IE is currently the default browser for the enterprise. I'm sure that you have workied with IE before too. Here's a little quirk that has been especially troublesome for my team and I lately.

Have you ever clicked on a dropdown box, made a selection and then moved the mouse out of the dropdown box and started to scroll the page with your mouse's track wheel? Then you know that in IE the page doesn't scroll, the items in the dropdown do. This can be a real headache since everytime the dropdown list item changes it fires off an event. And God help you if that event is tied to an AJAX callback.

Luckily, there is a way around this. A buddy of mine on the team found this article to explain everything. You just have to handle the 'onmousewheel' event. See the sample:

<select name="mylist" onmousewheel="return(false);">

Note: You don't have to worry about this in FireFox

No comments: