Advanced Search

Results 1 to 3 of 3

Thread: Change Image On Mouseover, retain onclick And play a sound!

  1. #1
    Join Date
    Nov 2008
    Posts
    43
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Default Change Image On Mouseover, retain onclick And play a sound!

    Ok this might be too much to ask but here goes..

    A-I want an image that when a user mouses over it swaps with another image

    B-I want this new image on mouseover to be retained if it is then clicked on (ie when clicked the new image which previously only appeared onmouseover has now swapped with the original)

    C-As well as the image being retained onclick I'd also like a short sound wav. to play when clicked (which would also stop playing upon being re-clicked).

    I know that the combination of A and B are possible (but not entirely sure how to do it) but I have no idea how to also add the play sound on click as well.

    The other issue is that most of the play sound file tecniques don't work cross browser but I'd be happy enough if I could get this working in at least IE and FF.

    If anyone can tell me how to do this I'd be very happy!

  2. #2
    Join Date
    Oct 2009
    Location
    Mumbai
    Posts
    17
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default

    you can make the buttons in flash and add sounds onmouseover, but i dont think it is possible in html / javascript to add sounds on butns.

  3. #3
    Join Date
    Nov 2009
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I had sort of the same problem. This probably isn't the correct way to do it, but it worked. I used onMousedown="playsound(sound1)" onClick="playsound(sound2)". The "sound2" file was empty, so the 2nd produced no sound.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •