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 6369763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:50:45+00:00 2026-05-25T00:50:45+00:00

I have a series of text links, which when rolled over, would cause a

  • 0

I have a series of text links, which when rolled over, would cause a specific image link to fade in; that image would not fade/change to a different image until a different text link was rolled over.

I did find some basic script that does this, albeit without a fade affect when the image changes:

<script language="javascript">
function roll(img_name1, img_src1)
{
document[img_name1].src = img_src1;
}
</script>

<ul>
<li><a href="1.htm" onMouseOver="roll('poster', '1.png')">111</a>
<li><a href="2.htm" onMouseOver="roll('poster', '2.png')">222</a>
<li><a href="3.htm" onMouseOver="roll('poster', '2.png')">333</a>
</ul>

<br><br><br><br>

<p align="center"><img src="1.png" name="poster"></p> 

A perfect example is http://sharifabraham.com/projects/, which I discovered in a similar post: hover on text link to change image. I’ve tried to edit and use the code in both of the aforementioned links, but to no avail. Any insight on what to do is much appreciated.

  • 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-25T00:50:46+00:00Added an answer on May 25, 2026 at 12:50 am

    I’ve dropped the inline JS code since it’s not the prefered way.

    I’ve added a data-attribute to the lis which contain the image to load.

    $(document).ready(function() {
      $('ul.image-switch li').mouseover(function() {
        var image_src = $(this).data('image');
        var img = $('.image-container img');
        if (img.attr('src') != image_src) { // only do the fade if other image is selected
          img.fadeOut('slow', function() { // fadeout the current image
            img.attr('src', img).fadeIn(); // load and fadein new image
          });
        }
      });
    });
    
    <ul class="image-switch">
      <li><a href="1.htm" data-image="1.png">111</a>
      <li><a href="2.htm" data-image="2.png">222</a>
      <li><a href="3.htm" data-image="2.png">333</a>
    </ul>
    
    <br><br><br><br>
    
    <p align="center" class="image-container"><img src="1.png" name="poster"></p> 
    

    EDIT

    Sorry made a type.

    DEMO: http://jsfiddle.net/yVcV3/1/

    EDIT 2

    http://jsfiddle.net/yVcV3/2/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a series of tables that contain data I want to full text
I have a series of buttons that display filenames. If I set the Text
I have 100 text files which contains time series starting and ending at different
I have a series of text files for which I'd like to know the
I have a series of links in a ul. Some have text and some
I've never come across this before: I have a series of text boxes. The
I have a series of checkbox inputs and corresponding text area inputs to allow
In a text file I will have a line containing a series of numbers,
I have a series of PHP page, and I would like to use conditional
I have a CSV-like text file that has about 1000 lines. Between each record

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.