Perhaps the path to the image itself isn't "./images" ?
Other than that,maybe some more code to show or better yet a live, non-
working page......
Rest assured the "hover" event does work, and the way to set an
<img>'s source is $(this).attr("src") ... there's something else not
seen/talked-about/thought-of that is the issue :-)
On Jan 7, 12:10 pm, Glen_H <[email protected]> wrote:
> I have it now set up like this:
>
> $("#footer #footer-contain #availability img").hover(function () {
> $(this).attr('src', './images/avail_hover.png'});
>
> }
>
> it still isnt working. I orig. had it set as src. but nothing seemed
> to be working then so i messed around and changed it to img src.
>
> any other ideas as to why it might not be working?
>
> On Jan 7, 11:41 am, MorningZ <[email protected]> wrote:
>
> > $(this).attr({'img src' : './images/avail_hover.png'});
>
> > there is no "img src" attr, but there is "src", so
>
> > $(this).attr('src', './images/avail_hover.png');
>
> > and there's a second event to hook on the .hover event is when you
> > mouse off, so use that event to revert back to whatever image was
> > there
>
> > On Jan 7, 11:02 am, Glen_H <[email protected]> wrote:
>
> > > In my footer I have a sign where I want it to say one thing regularly,
> > > and then when someone hovers, i want it to say sometyhing else. I
> > > basically made 2 images, and I just want to switch images on the
> > > hover.
>
> > > here is my code I used and its not working.:
>
> > > $("#footer #footer-contain #availability img").hover(function () {
> > > $(this).attr({'img src' :
> > > './images/avail_hover.png'});
> > > }
>
> > > can anyone help me out with what I need to do?