/ Published in: jQuery

Each image button requires two images to represent two states: the off-state and the on-state. In this case, the on-state has "_ovr" appended.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// onrollover button for form submit image buttons - toggle "_ovr" to the filename $("form input[type='image'][src*='images/form_submit_']").hover( function () { $(this).attr('src', function() { return this.src.replace('.png', '_ovr.png'); }); }, function () { $(this).attr('src', function() { return this.src.replace('_ovr', ''); }); } );
Comments
