A web developer's blog. PHP, MySQL, CakePHP, Zend Framework, Wordpress, Code Igniter, Django, Python, CSS, Javascript, jQuery, Knockout.js, and other web development topics.

Monthly Archives: September 2011

jQuery: Generic Image Swap

Found this little gem in Stackoverflow. $(function() { $("img") .mouseover(function() { var src = $(this).attr("src").match(/[^.]+/) + "over.gif"; $(this).attr("src", src); }) .mouseout(function() { var src = $(this).attr("src").replace("over", ""); $(this).attr("src", src); }); }); Thanks to Jarrod Dixon. Here is another simpler version. … Continue reading

Posted in General | 2 Comments