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

  • Home
  • SEARCH
  • 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 578569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:16:28+00:00 2026-05-13T14:16:28+00:00

I like to have a portfolio that is dynamic and simple to update. In

  • 0

I like to have a portfolio that is dynamic and simple to update.

In one part there will be some little square preview, and hovering or clicking on these preview will update the LARGE section with the whole job.

I know pretty good the : MM_swapImage(), but like to do it in jquery or ajax.

How can I do that?

Some research result : http://code.google.com/p/jquery-swapimage/

—

<SCRIPT LANGUAGE="Javascript">
function swap(pic1, pic2)
{
var pic1 = document.getElementById("pic1");
var pic2 = document.getElementById("pic2");
var pic1src = pic1.src;
var pic2src = pic2.src;
pic2.src = pic1src;
pic1.src = pic2src;
}
</SCRIPT>
  • 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-13T14:16:28+00:00Added an answer on May 13, 2026 at 2:16 pm

    Here’s my code (just an example, it needs changes to work for you)

    $('#imageswitch img').hover(
                    function () {
                        var oldsource = $(this).attr('src');
                        var foldername = oldsource.substr(0, oldsource.lastIndexOf('/'));
                        var filename = oldsource.replace(foldername+'/','');
                        var newsource = foldername + '/' + 'hover_' + filename;
                        $(this).attr('src', newsource);
                        $(this).data('src', oldsource);                   
                    }, 
                    function () {
                        $(this).attr('src', $(this).data('src'));
                    }
                );
    

    Create a folder for the images.
    The small images are called:
    image_1.jpg

    the larger images are called
    hover_image_1.jpg

    (note the ‘hover_’ before the filename)

    Hover over an image and it replaces it’s source with the new source (the larger image), when you leave the image with the mouse the old source is restored.

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

Sidebar

Related Questions

I would like to have an AppWidget that designed like this one . Image:
I'm building a site that is a portfolio of projects. I have some pagination
I have a portfolio that shows 3 rows of images in one page. it
I have a grid of divs that show some of my work (portfolio), and
I have a friend that is making a portfolio site. He has some high
I'm creating simple application, some kind of portfolio. I've heard that it's better to
Live site. Ideally, between border-top and border-bottom, I'd like to have 3 portfolio thumbnails,
So in my project i would like have a nice treeview that has images.
I have a C++ project that have like 15+ external libraries installed with a
I have pictures that I would like to have expand across an entire page

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.