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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:54:23+00:00 2026-06-02T04:54:23+00:00

I have a grid of many images and each image has a CSS class

  • 0

I have a grid of many images and each image has a CSS class set to it’s unique ID.

Using this javascript code, I’d like to ask my server backend to construct an appropriate HTML summary of said element and return it.

$('.tier-items a img').qtip({
    content: {
        text: 'Loading...', // The text to use whilst the AJAX request is loading
        ajax: {
            url: '/Items/GetToolTip/' + $(this).attr("class"), //I assumed that $(this) would contain the element I moused over.
            type: 'GET', // POST or GET
            data: {} // Data to pass along with your request
        }
    },
    style: {
        classes: 'ui-tooltip-youtube ui-tooltip-shadow'
    },
    position: {
        my: 'bottom center',
        at: 'top center',
        effect: function (api, pos, viewport) {
            // "this" refers to the tooltip
            $(this).animate(pos, {
                duration: 600,
                easing: 'linear',
                queue: false // Set this to false so it doesn't interfere with the show/hide animations
            });
        }
    }
});

However it seems that in this case $(this) doesn’t contain the element that has been moused over to invoke the qTip.

I need to invoke a url like:

/Items/GetToolTip/23

Instead I get:

/Items/GetToolTip/undefined?_=1334977600119

Is there some way to get the element where the QTip was invoked?


Tried this, and still no dice:

itemHoverId = 1;

//Construct the id, on mouseenter and use that instead of $(this)
$('.tier-items a img').mouseenter(function () {
    itemHoverId = $(this).attr("class");
    alert(itemHoverId);
});

$('.tier-items a img').qtip({
    content: {
        text: 'Loading...', // The text to use whilst the AJAX request is loading
        ajax: {
            url: '/Items/GetToolTip/' + itemHoverId, //I assumed that $(this) would contain the element I moused over.
            type: 'GET', // POST or GET
            data: {} // Data to pass along with your request
        }
    },

The resulting invoke is:

/Items/GetToolTip/1?_=1334978818620
  • 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-06-02T04:54:26+00:00Added an answer on June 2, 2026 at 4:54 am

    The problem is that this is referring to whatever this is when the initialization method is called and not your image (ie probably your document ready)
    If you need an individual url for each img you could create a qtip widget individually

    $('.tier-items a img').each(function() { $(this).qtip({
    content: {
        text: 'Loading...', // The text to use whilst the AJAX request is loading
        ajax: {
            url: '/Items/GetToolTip/' + $(this).attr("class"), //I assumed that $(this) would contain the element I moused over.
            type: 'GET', // POST or GET
            data: {} // Data to pass along with your request
        }
    }, ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have grid of images, when the mouse is over any given image a
I am using vb.net code. I have grid view, please see the code below:
how to write the below code using struts2 tag library. since struts2 have many
I have used datagrid on many projects populate the grid using the following Usual
I know there have been many questions on grid and pack in the past
I have grid with some textboxes and an image which goes out of grid
I have grid something like this: Ext.define('Exp.view.dashboard.Tv', { extend: 'Ext.grid.Panel', initComponent: function() { this.columns
I have an application with many images that all look the same and perform
I have a Grid with many TextBoxes and I want to call NotifyPropertyChanged() method
I have a class that defines a Hierarchical RadGrid that I will be using

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.