I needed to test out the mouse events in jQuery. There are many of them. Working with mouse events has given me a headache with anything past click(). In fact, the reason for this post was born out of attempts to perform client-side validation on textareas (specifically maximum character counting). Since there is no way that I'm aware of to detect a right-click & paste consistently, I have tried a number of keyboard and mouse event combinations to stop those crazy users from running with scissors. One interesting thing I discovered is that when you're using dblclick(), three events are actually fired: click, click and then dlbclick. This makes sense when I think about it, but at first it wasn't expected. I could see this being a conflict at some point or another.
So, I've built a page to play around with these events. You can toggle each mouse event to activate/deactivate it by clicking the colored Off/On area beside an event name. Performing an event on the target in the middle of the page will trigger updates to a log table of the events and their consecutive hits. I added the consecutive hit counters because some events (and I'm looking at you mousemove()) like to go ballistic. I'll be adding support for more types of targets, since focusin() and focusout() can't do much with the current setup. An update will be posted very soon, I promise. Click the links below to play around or grab the source. Please note the comments in each file concerning usage and rights.
Demo February 22, 2010: Updated to v2.0
Source February 22, 2010: Updated to v2.0
P.S. Along the way, I finally got around to learning a little about live() and die(), and they're quite beautiful. Your application will literally live or die if it depends on events being fired on AJAX-loaded elements. If you use the element.event(function...) method of assigning events, they don't carry over to new elements.
- Start the ColdFusion 8 installer.
- Select the option for multiple servers.
- Select an installation directory. This should be the root for your sites.
- Add a web server, select apache. For the first option replace /etc/httpd with /etc/apache2.
- Complete the installation.
- The service will be unable to start and you will get a message saying so.
- cd /Applications/JRun4/lib
- unzip -d src wsconfig.jar
- cd src/connectors/src
- apxs -c -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386 -n jrun22 \
mod_jrun22.c jrun_maptable_impl.c jrun_property.c jrun_session.c \
platform.c jrun_mutex.c jrun_proxy.c jrun_utils.c - apxs -i -n jrun22 -S LIBEXECDIR=/Applications/JRun4/lib/src/connectors/src/ mod_jrun22.la
- strip mod_jrun22.so
- sudo java -jar /Applications/JRun4/lib/wsconfig.jar
- sudo cp /Applications/JRun4/lib/src/connectors/src/mod_jrun22.so \
/Applications/JRun4/lib/wsconfig/1/mod_jrun22.so - sudo apachectl restart
- ppc7400: -Wc,-arch -Wc,ppc7400 -Wl,-arch -Wl,ppc7400
- ppc64: -Wc,-arch -Wc,ppc64 -Wl,-arch -Wl,ppc64
- i386: -Wc,-arch -Wc,i386 -Wl,-arch -Wl,i386
- x86-64: -Wc,-arch -Wc,x86_64 -Wl,-arch -Wl,x86_64
- sudo mv /usr/sbin/httpd /usr/sbin/httpd.ub
- sudo lipo -thin ppc7400 /usr/sbin/httpd.ub -output /usr/sbin/httpd.ppc7400
- sudo ln -s /usr/sbin/httpd.ppc7400 /usr/sbin/httpd