javascript - Swap Images With jQuery hover -
I have an IMG tag with the following details: id = "hover1" src = "HelloPG" However, when I try to swap the images with the following code, then nothing like this happens. The code looks good to me, is it failing? Please help me I am using jQuery 2.1.0, Mozilla 26.0, Windows 7. Thank you. see it .. thanks
$ ('# button1'). Click (function () {$ ('# hover1'). Attr ('src', 'hello_hover.png');}); $ ('# button2'). Click (function () {$ ('# hover1'). Attr ('src', 'hello.png');});
$ ('# hover1'). Hover (function) {$ (This) .attr ('src', 'hello_out.png')}}, function () {$ (this) .attr ('src', 'hello.png');});
$ (function () {$ ('an img'). Hover (function ) {$ (This) .attr ('src', $ (this) .attr ('src'). Replace (/ .jpg /, 'yourImageName.jpg'));});
Comments
Post a Comment