Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Disable wheel on mouse


freakystreak

Recommended Posts

Does anyone know how to disable the user's scroll wheel on their mouse when using an OSC site? having users using scroll wheels to enter details then using it to scroll down the page causes the information to change.

 

Any ideas?

Ah, the world wide web. What a wonderful place.

Link to comment
Share on other sites

As far as i know you can add onmousewheel="return false;" to the select tag for that box or using java I think you could use something like:

 

if (window.attachEvent && document.getElementsByTagName) {
var  sel = document.getElementsByTagName("select");
for (var i = 0; i; sel.length; ++i) {
	if (sel[i].size == 1) {
		sel[i].attachEvent('onmousewheel', function() {return false;});
	}
}
}

 

I think this will only work on IE6, IE5 doesnt support the event onmousewheel.

Hope that helps get ya started.

Link to comment
Share on other sites

As far as i know you can add onmousewheel="return false;" to the select tag for that box or using java I think you could use something like:

 

if (window.attachEvent && document.getElementsByTagName) {
var  sel = document.getElementsByTagName("select");
for (var i = 0; i; sel.length; ++i) {
	if (sel[i].size == 1) {
		sel[i].attachEvent('onmousewheel', function() {return false;});
	}
}
}

 

I think this will only work on IE6, IE5 doesnt support the event onmousewheel.

Hope that helps get ya started.

 

 

Many Thanks

Ah, the world wide web. What a wonderful place.

Link to comment
Share on other sites

Does anyone know how to disable the user's scroll wheel on their mouse when using an OSC site?

 

WOW, you should really consider that before implementing such a feature on your site. Taking control of or altering a visitors system is considered bad practice as it usually makes the person nervous. People tend to think if something is going screwy, what else is going on? And they tend not to return. Best to leave it up to the people with the scroll wheels to click outside the selection boxes before they scroll, most know they have too anyway.

 

Just passing on a tid bit that was told to me at college.

 

;)

- :: Jim :: -

- My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 -

Link to comment
Share on other sites

I totally agree. First of all I'm used to the fact that scrolling without clicking outside the box changes the data and secondly I absolutely hate it when a website disables the right mouse button or the wheel (why do you think I have a wheel mouse?) or worst of all resizes my window.

 

abra

The First Law of E-Commerce: If the user can't find the product, the user can't buy the product.

 

Feedback and suggestions on my shop welcome.

 

Note: My advice is based on my own experience or on something I read in these forums. No guarantee it'll work for you! Make sure that you always BACKUP the database and the files you are going to change so that you can rollback to a working version if things go wrong.

Link to comment
Share on other sites

My am I glad you guys replied with what I was thinking! I was trying to work out why you would want to anyway? I also get really cross when things don't work as I want them too :D

 

My biggest hate is sites that disable the back button grrrrrr. It does not make their sites sticky just makes me never want to visit them again for interfering with my browsing habits.

Link to comment
Share on other sites

You could also try to move the focus to another field with the handler onmouseout or onchange so once its selected the focus moves to another field that doesnt have that problem. Just a thought.

I to hate it when things are disabled.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...