Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6929929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:22:50+00:00 2026-05-27T11:22:50+00:00

I am trying to do images swaps on mouseovers in an existing slideshow function.

  • 0

I am trying to do images swaps on mouseovers in an existing slideshow function. The slideshow function requires me to add values to an array. Within that array I want to call my onMouseOver event handlers, but I believe I am running into an issue with escapable characters.

My attempt:

var leftrightslide=new Array()
leftrightslide[0]='<a href="#" onMouseOver="copyspeed=0; document.blah.src=\'images/slides/slideshow_top_01_mo.gif\'" onMouseout="copyspeed=slidespeed"><img src="images/slides/slideshow_top_01.gif" name=\'blah\'></a>';

On my MouseOvers, nothing is happening, but when I try to replicate this in just HTML, it works fine. This is what leads me to believe I am not handling the apostrophes in my event handler correctly:

<a href="" onMouseOver="document.blah2.src='images/slides/slideshow_top_01_mo.gif';" onMouseout="document.blah2.src='images/slides/slideshow_top_01.gif'"><img src="images/slides/slideshow_top_01.gif" name='blah2'></a>

Edit: Here is a link to a test page with full javascript.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:22:51+00:00Added an answer on May 27, 2026 at 11:22 am

    Seems to me that your scripted version is failing because blah is not unique. Each instance will need a unique reference name.

    Alternatively, pass this along with your mouse actions to identify the target.

    EDIT

    Something like this:

    <script>
        function over(a){
            a.firstChild.src="bbb.jpg";
        }
        function out(a){
            a.firstChild.src="aaa.jpg";
        }
    </script>
    <a onmouseover="over(this)" onmouseout="out(this)"><img src="aaa.jpg"/></a>
    <a onmouseover="over(this)" onmouseout="out(this)"><img src="aaa.jpg"/></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add images to my models in my Django app. models.py class
I'm trying to download images (.jpg) from web folder using wget. I want to
While trying to paste images, I noticed that Cases[] is very slow. To reproduce,
I am trying to display images in a WinForms ListView that is in details
I am trying to scale images to fit within their parent element width, and
Im trying to change images on click similar to what SO does with the
I am trying to save images using the following code: - (void)writeData{ if(cacheFileName==nil) return;
I'm trying to display images using my web application written in Rails. I've come
I'm trying to download images from URLs and pass them to PIL. I would
I have an annoying CSS layout problem. I'm trying to float images on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.