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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:07:21+00:00 2026-05-28T07:07:21+00:00

I am using the qtip2 library which looks like this: $(‘.selector’).qtip({ // options //

  • 0

I am using the qtip2 library which looks like this:

$('.selector').qtip({ // options // });

However I have three different selectors which use three different set of options.

Is there a way to write the .qtip part as a function so I can pass the selector, and the options as arguments? I am just changing the position for different selectors, that’s the only thing that is changing…

function doMyQtip(selector, "top left", "bottom right") {

}
  • 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-28T07:07:22+00:00Added an answer on May 28, 2026 at 7:07 am

    Try this:

    function changeQtipVars(pos1, pos2){
    
        var tooltip_opts = {
        position: {
                corner: {
                   target: pos1,
                   tooltip: pos2
                }
        }
        }
        return tooltip_opts;
    }
    
    $('.selector').qtip({
       content: 'Displays the number of results based on your search criteria.',
       show: 'mouseover',
       hide: 'mouseout',
       style: changeQtipVars(pos1, pos2);
    })
    

    You can also try a switch case, but that works out to be a tad tedious. You may also want to read up on JQuery’s extend function – http://api.jquery.com/jQuery.extend/ for extending reusable code. Hope this helps.

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

Sidebar

Related Questions

I'm using jquery.qTip on http://comps.gunnjerkens.com/phws/services/ Looks beautiful with the drop shadow and rounded borders
i have an asp.net mvc site and here is a dynamic tooltip using qTip
I have a jquery fullcalendar . I would like to trigger jquery QTip (or
$('.selector').qtip({ content: { text: function(api) { return $(this).children('.tip').clone(); } }, style: { classes: 'ui-tooltip-rounded',
I am using qTip: http://craigsworks.com/projects/qtip2 and my current problem is that when I hover
I am using a tooltip plugin called qTip2. I would like to be able
Hi, I am using qTip on my site and this is how the document
Its a bit difficult for me to explain this. I am using qtip to
I have a fullCalendar page that I am using qTip (v2) on. The problem
I have 3 buttons within update panel. Each of them using qTip plugin. Outside

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.