I have a client who loves this feature on Zappos.com - go to any product, and mouseover where there are color choices. A small image hovers there, with rounded corners and a transparent shadow, and she wants that effect. I'm having a heckuva time finding the script to make that happen.
Hey @Josh, I have a quick question about the jQuery you wrote. I'm just wondering why and when you should use function(e) and when you should just use function(). I know about passing variables into functions eg: function(i), and I understand that e is shorthand for event, but even after looking here: http://api.jquery.com/event.data/ I still don't understand how I should use it.
Maybe this should be a separate discussion, but just thought I'd ask it here as it featured in the code you wrote.
@Johnnyb, unlike many languages, with JavaScript, you can pass any number of arguments to a function whether the function accepts them in its definition or not.
In the case of the event parameter, you don't need to capture it in the function's definition unless you plan on using it (e.g. var el = e.target). In the example @Josh gave, the script would work fine with or without the "e" parameter. Now, if he needed to get some information from the event object, it would have been required.
Any ideas? Thanks much for any leads!
Maybe this should be a separate discussion, but just thought I'd ask it here as it featured in the code you wrote.
Many thanks!
In the case of the event parameter, you don't need to capture it in the function's definition unless you plan on using it (e.g. var el = e.target). In the example @Josh gave, the script would work fine with or without the "e" parameter. Now, if he needed to get some information from the event object, it would have been required.