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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T03:38:38+00:00 2026-05-30T03:38:38+00:00

I found this wonderfull tooltip called qTip2. Loving it so far but has gotten

  • 0

I found this wonderfull tooltip called qTip2. Loving it so far but has gotten myself into a problem using it.

I was able to install and get qTip2 running with my Rails 3.1 setup. However I’m running into a problem when I’m using qTip2’s ajax functionality.

qTip2 ajax request requires a link to the script to be executed before displaying it in the tooltip content div (which is automatically generated by qTip2). You can look at the code I’m referring to here.

http://www.craigsworks.com/projects/qtip2/demos/#ajax

The problem with it is that it does not really go well with RoR. An ajax request declared using RoR is more explicit, where I can explicitly tell rails which div id I would like to update.

Given the following circumstances I needed to do the following things:

  1. the tooltip content must be dynamic
  2. I needed to use the qTip2 ajax functionality so that I could create a custom layout for the tooltip content.

I did try the followings though:

  1. Put the html snippet to be loaded to the content div in the public folder. The content loaded with the right format but I can’t have dynamic content. html.erb files didn’t seem to work in this folder. Is there any alternative to this folder that would work but with dynamic content?

  2. Tried to use qTip2 ajax request with RoR but was not successful. What I did was I tried to explicitly define the ajax update id in the .js respond file (going through the controller and views etc.). But figuring out the exact id that was generated by qTip2 plugin was a little too overwhelming for me.

here is what I have

html

 <a id="editor1" href="/deals_details.html.erb">

javascript

$(document).ready(function()
{

   $('#editor1').each(function()
   {
      $(this).qtip(
      {
         content: {
            text: '<img class="throbber" src="/assets/throbber.gif" alt="Loading..." />',
            ajax: {
               /*once: false*/
               url: $(this).attr('href') 

            }, 
            title: {
               text: 'qTip2 Test', 
               button: true
            }
         },
         position: {
            at: 'center', 
            my: 'center',
            viewport: $(window), 
         },
         show: {
            event: 'click',
            solo: true 
         },
         hide: 'unfocus',
         style: {
            classes: 'ui-tooltip-wiki ui-tooltip-light ui-tooltip-shadow'
         }
      })
   })

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

CSS

.ui-tooltip-wiki{
   max-width: 440px;
}

   .ui-tooltip-wiki .ui-tooltip-content{
      padding: 10px;

      line-height: 12.5px;
   }

   .ui-tooltip-wiki h1{
      margin: 0 0 7px;

      font-size: 1.5em;
      line-height: 1em;
   }

   .ui-tooltip-wiki img{ padding: 0 10px 0 0; }

   .ui-tooltip-wiki p{ margin-bottom: 9px; }
   .ui-tooltip-wiki .note{ margin-bottom: 0; font-style: italic; color: #888; }

Please help me!! 🙂 Apology if this post looks stupid, this is my first question on stackoverflow.

  • 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-30T03:38:39+00:00Added an answer on May 30, 2026 at 3:38 am

    I think you’re making it too complicated. The qTip ajax functionality simply requests a URL, and the return value is HTML content within a div tag. If you look at the source of the demo you mentioned, you’ll see a request for http://www.craigsworks.com/projects/qtip2/data/burrowingowl.php. If you look at what that produces, it is simply a div tag with some content (the style looks different because it is further transformed by the page’s CSS).

    So the question becomes: can you provide your dynamic content in a div in response to a URL in Rails? Of course! Perhaps you want to set up a SnippetController with a show action and then using pretty standard Rails conventions/routes your URL might be /snippet/show/[ID] and you simply have the view produce the required div content.

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

Sidebar

Related Questions

Found this: Sub SurroundWithAppendTag() DTE.ActiveDocument.Selection.Text = .Append( + DTE.ActiveDocument.Selection.Text + ) End Sub But
I found this link http://artis.imag.fr/~Xavier.Decoret/resources/glsl-mode/ , but there isn't a lot of description around
I found this in an article on Multithreaded Apartments, but can’t find a definition
I found this guide for using the flash parameters, thought it might be useful
Found this method of having DIV as custom google maps infoWindow. It works, but
So I found this wonderful library called WatiN - and I've downloaded the latest
I have searched and searched for a solution to this problem, but it seems
Found this code that breaks out CSV fields if contains double-quotes But I don't
Found this question but there is no proper answer, so asking again. How do
I found this wonderful clone function for javascript ( http://my.opera.com/GreyWyvern/blog/show.dml/1725165 ), but it breaks

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.