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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T20:40:02+00:00 2026-05-14T20:40:02+00:00

On a page I have a sortable list with thumbnails. When rolling over the

  • 0

On a page I have a sortable list with thumbnails.
When rolling over the images I wanted a tooltip to show a bigger image.
I found qTip, but maybe there is something better / easier?

How can I connect the imgPath var from the sortable to the qtip?

var imgPath = '<img src="002171/imm/001.jpg" />';

$("#sortable").sortable();
$("#sortable").disableSelection();

$('#sortable li img').qtip({
    content: {
        text: imgPath
    }
});


<div id="demo">
    <ul id="sortable">
        <li><img src="002171/tn/001.jpg" /></li>
        <li><img src="002171/tn/002.jpg" /></li>
        <li><img src="002171/tn/003.jpg" /></li>
    </ul> 
</div>
  • 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-14T20:40:03+00:00Added an answer on May 14, 2026 at 8:40 pm

    I posted a demo for you. As much as I like qTip, it isn’t easy to figure out how to set it up to grab content from within the current HTML.. I spent 20 minutes messing with it until I gave up. But, good news is I do know that this tooltip script has three versions, and one is specifically made for image previews.

    So you’ll need to reformat your HTML a bit. the href in the <a> contains the large image that shows up in the tooltip while the <img src> contains the thumbnail. You can also include a caption in the tooltip by adding text/HTML into the title attribute of the link (see the first image in the code below).

    HTML

    <div id="demo">
        <ul id="sortable">
            <li><a class="preview" href="01.gif" title="This image has a caption"><img src="01.gif" /></a></li>
            <li><a class="preview" href="02.gif"><img src="02.gif" /></a></li>
            <li><a class="preview" href="03.gif"><img src="03.gif" /></a></li>
            <li><a class="preview" href="04.gif"><img src="04.gif" /></a></li>
            <li><a class="preview" href="05.gif"><img src="05.gif" /></a></li>
            <li><a class="preview" href="06.gif"><img src="06.gif" /></a></li>
            <li><a class="preview" href="07.gif"><img src="07.gif" /></a></li>
            <li><a class="preview" href="08.gif"><img src="08.gif" /></a></li>
            <li><a class="preview" href="09.gif"><img src="09.gif" /></a></li>
            <li><a class="preview" href="10.gif"><img src="10.gif" /></a></li>
        </ul> 
    </div>
    

    CSS

    .preview { cursor:pointer; }
    #preview {
        color: #ddd;
        background: #222;
        border: 1px solid #333;
        padding: 5px;
        display: none;
        opacity: 0.9;
        filter: alpha(opacity=90);
        text-align: center;
    }
    

    Script

    $(document).ready(function(){
        $("#sortable").sortable();
        $("#sortable").disableSelection();
    });
    
    // You should load the image preview script below separately
    // but I've included it here for completeness
    
    /*
    * Image preview script
    * powered by jQuery (http://www.jquery.com)
    *
    * written by Alen Grakalic (http://cssglobe.com)
    *
    * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
    *
    */
    
    this.imagePreview = function(){    
        /* CONFIG */
        xOffset = 10;
        yOffset = 30;
        // these 2 variable determine popup's distance from the cursor
        // you might want to adjust to get the right result
        /* END CONFIG */
        $("a.preview").hover(function(e){
            this.t = this.title;
            this.title = "";    
            var c = (this.t != "") ? "<br/>" + this.t : "";
            $("body").append("<p id='preview'><img src='"+ this.href +"' alt='Image preview' />"+ c +"</p>");                                 
            $("#preview")
                .css("top",(e.pageY - xOffset) + "px")
                .css("left",(e.pageX + yOffset) + "px")
                .fadeIn("fast");                        
        }, function(){
            this.title = this.t;    
            $("#preview").remove();
        });    
        $("a.preview").mousemove(function(e){
            $("#preview")
                .css("top",(e.pageY - xOffset) + "px")
                .css("left",(e.pageX + yOffset) + "px");
        });            
    };
    
    // starting the script on page load
    $(document).ready(function(){
        imagePreview();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page where i have a sortable list of items (a div
i have a form and a sortable() list where a user can drag from
I have this ASP.NET page with ASP.NET UpdatePanel and jQueryUI droppable and sortable components.
I have a question, I have a sortable list and also a dialog box
I have a page using jQuery with some lists which have been made sortable.
I have a selector like this: $list = $('ul.sortable'); for jQueryUI's sortable plugin. There
I have two sortable lists that are connected. One is simply on the page,
I have been working on a sortable list. I want to implement a sortable
In my page I have a sortable. At current I have some code like
I have a page that lists all of the projects that has sortable headers

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.