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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:57:13+00:00 2026-06-07T13:57:13+00:00

I have below function which executes the qtip2 tooltip on certain divs ( #block_profile

  • 0

I have below function which executes the qtip2 tooltip on certain divs ( #block_profile ) the problem is that it gets triggered multiple times. So If I click a 4th #block_profile it calls this function 4 times. How Can I make it only execute for the exact div that has been clicked?

// Create the tooltips only on document load
$(document).ready(function () {
    // Make sure to only match links to wikipedia with a rel tag
    $('div.block_profile[rel]').each(function () {


        // We make use of the .each() loop to gain access to each element via the "this" keyword...
        $(this).qtip(
            {
                content:{
                    // Set the text to an image HTML string with the correct src URL to the loading image you want to use
                    text:'<img src="/assets/ux/modal/loading.gif" alt="Loading..." />',
                    ajax:{
                        url:'/profiles/get_info/' + $(this).attr('rel') // Use the rel attribute of each element for the url to load
                    },
                    title:{
                        button:false
                    }
                },
                position:{
                    my:'top left',
                    target: 'mouse',
                    viewport:$(window), // Keep the tooltip on-screen at all times
                    adjust:{
                        x:10, y:10
                    }
                },
                hide:{
                    fixed:false // Helps to prevent the tooltip from hiding ocassionally when tracking!
                },
                style:{
                    classes:'container ui-tooltip ui-tooltip-tip'
                }
            })
    })

        // Make sure it doesn't follow the link when we click it
        .click(function (event) {
            event.preventDefault();
        });
});

the html:

<div id ="block_profile" class ="block_profile rel="1">div 1</div>
<div id ="block_profile" class ="block_profile rel="2">div 2</div>
<div id ="block_profile" class ="block_profile rel="3">div 3</div>
<div id ="block_profile" class ="block_profile rel="4">div 4</div>
<div id ="block_profile" class ="block_profile rel="5">div 5</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-06-07T13:57:15+00:00Added an answer on June 7, 2026 at 1:57 pm

    You should use the following code:

    // Create the tooltips only on document load
    $(document).ready(function () {
        // Make sure to only match links to wikipedia with a rel tag
        $('div.block_profile[rel]')
            .qtip({
                ...
            })
            .click(function (event) {
                event.preventDefault();
            });
    });
    

    The each call isn’t necessary. Check out this demo for example.

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

Sidebar

Related Questions

I have a function which sorts data in a multidimensional array, as shown below:
I have a function(please see code below) which reads some data from the web.
I have a function to create a pdf which should return bitarray. Below is
I have the function below. It gets the values from checked boxes and transfer
I have an example function below that reads in a date as a string
Suppose that I have a database query which looks like below - select name,
I have the below java script function in which I want to redirect the
Below, I have a java script function (named stateChange) which is expected to update
I have written the java code below, which executes another java program named Newsworthy_RB.
I have an oracle function which is given below. when I run this in

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.