JD’s comment may work but also something to consider is that the image can be connected to the hover part of the box, you don’t actually need to handle that through code
To do that click the bolt symbol and add a hover interaction to your box then choose an image that should appear on hover.
Hi Amanda, thank you for your reply. Indeed, the hover states would normally be the way to go. The reason I’m instead trying to do this through code is because I’m trying to figure out a way I can control an animated gif to play when only on rollover.
The “sun” image was just a test for what I’m trying to achieve. But in actual fact, what I have is a character with no mouth and with animated eyes thats in a loop, and I also have a mouth gif that would animate through about 5 different frames, then it would stop on a smile. I will place it on top of his face. I don’t want the mouth animated gif to be looped, so I’ve set it to not loop. However, when using the “Hover Interaction” method, whenever i rollover, it seems that the mouth animation has already played through it’s 5 frames and now is static by the time it’s revealed on mouseover.
So I was hoping to control this mouth gif by using code to play the gif animation ONLY on rollover. It’s a tough one to explain, I hope the images gives you some more insight.
@jonatandor35 I hastily copied and pasted the code to recreate the error, because in my frustration, I had deleted the lot. So this was my bad for when I took the screenshot, it indeed had the wrong coding. Again, sorry about that. Here it is again, with the adjusted coding, screenshot of what I have.
@jonatandor35 Of course, I’m a shmo I did, indeed have it set to “hidden”, which I thought was required. The code does the hidding for me, so … yes, I’m learning now Thank you J.D.
However, it seems once I “mouseout”, it doesn’t seem to re-apear on the second mousein… but it doesn’t matter, because ultimitatley, my theory of getting the gif animation to play from start to finish was proven wrong, even with this method. Seems that the gif animation, while on page load, will automatically play the frames, and does NOT re-start on any sort of “hover” actions, including this coding. Not a big deal I suppose, it just looked weird for my animated character to have a looping mouth for just a few words, hence I wanted just about 5 frames to play and then stop. Anyway, thank you again J.D.
@valym777 I’m not sure what you were trying to do, but if you wanted to show it up once the mouse got into the area of the hidden element, you should put it in a transparent box (which will never be hidden), and apply the onMouseIn and onMouseOut to his parent box.
@valym777
So if i understand correctly,
You have a man with moving eye’s
this image will keep looping?
Then you have a mouth that moves
but when not on rollover, the mouse does not moves,
Then when on “mouseIn” it loops 1 time.
Is this correct?
Ifso, i downloaded the images to test hingst out. Kind regards, Kristof.