Onmousewheel Event?

Rhonda

Senior Member
I came across a neat little effect that I'd love to try and learn to make work. It is on a site called "JavaScript Kit" and essentially what happens is you hover your mouse over an image, and scrolling up or down using the mouse wheel, will change the picture. But the site says the script is supported by IE6, Opera9, Safari2, and Firefox.

I attempted to use it but in a Google Chrome browser, but it didn't work. However I don't know if this is because its just not supported by Chrome (yet?) or if the example images were not on my computer. And the site does not really say where the images need to be for the script to work.

As always keep in mind I am very new to coding. If you need, I can post an example of the script. Guess what I wonder is there a way to make this work in any browser?
 
Sorry, can't answer most of your questions but both Safari and Chrome are built on WebKit so in theory, if something works with one, then it should with the other.
 
Cant see why this wont work ~ The onmousewheel event of JavaScript

Ignore Chrome load Safari and test in that, Safari implements everything before Chrome and Chrome is a cop out built on Safari's code, Webkit. :)

This has been implemented for a while now though in Safari.

But to get it to work in a non-IE browser you require different code as IE uses a different syntax. That above link works in FireFox so should work fine in Safari. If you need help editing the code paste what you have up and I'll have a look over it for any errors. :)
 
Well, that page you linked was where I found it originally. Can't think of anything I would use it for just now except to practice with. Maybe just on a mock up site that is only on my PC's drive. Presumably this could be used with URLs to images that are on line right? I don't have installed but that should be easy enough to try right?
 
Without testing the code myself I couldn't say for sure as I haven't spent time looking at it but by changing these to reference absolute image paths ~
var myimages=[
"summer.jpg",
"spring.jpg",
"winter.jpg"
]


I cant see why not. That code works in Safari so i cant see why it shouldn't work in Chrome.

If you get any problems implementing your code let me know. :)
 
Back
Top