Jump to content

Recommended Posts

Displaying the image is no problem, it's positioning it. As ohdang888 said there'll be plenty of jQuery (or other framework) plug-ins available, but I shouldn't think something so simple would really need a bloated plug-in.

 

Can you give more information on how you want the pop-up positioned? Plus, are you using a framework or just standard JavaScript?

Using jQuery this would be a simple task. A VERY simple example, not tested.

 

<html>
  <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
    <script>
      $('#thumbs ul li').hover(
        function() {
          img = $(this).find('img').attr('src').replace('-thumb', '-full');
          $('#stage').html('<img src="' + img + '" />');
        },
        function() {
          $('#stage').html('');
        }
      );
    </script>
  </head>
  <body>
    <div id="thumbs">
      <ul>
        <li><img src="image1-thumb.jpg" /></li>
        <li><img src="image2-thumb.jpg" /></li>
        <li><img src="image3-thumb.jpg" /></li>
      </ul>
    </div>
    <div id="stage"></div>
  </body>
</html>

 

You'll need the images image1-thumb.jpg , image1-full.jpg etc etc

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.