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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:40:00+00:00 2026-06-08T17:40:00+00:00

I am using FancyBox and a very simple jQuery tooltip together, if not clicked

  • 0

I am using FancyBox and a very simple jQuery tooltip together, if not clicked on images yet, the tooltip is for showing the “titles” on the page. If clicked a image the fancybox will take over the title to display title tag “inside”.
The title doesn’t show up once clicked the image, but the tooltip is OK. Is it possible to make them work together?

Here is the jQuery for tooltip:

$(document).ready(function(){
    tooltip();
});

this.tooltip = function(){  
    $("a.tooltip").hover(function(e){                                             
        this.t = this.title;
        this.title = "";                                      
        $("body").append("<p id='tooltip'>"+ this.t +"</p>");
        $("#tooltip").fadeIn("fast");       
    },
    function(){
        this.title = this.t;        
        $("#tooltip").remove();
    }); 
    $("a.tooltip").mousemove(function(e){
        $("#tooltip")

    });         
};

Here is my FancyBox code:

<script type="text/javascript">
    $(document).ready(function() {
        $("a#example8").fancybox({
            'titlePosition': 'over'
        });
    });
</script>

This is HTML code:

<a id="example8" class="tooltip" href="./example/8_b.jpg" title="Sed vel sapien vel sem tempus placerat eu ut tortor. Nulla facilisi. Sed adipiscing, turpis ut cursus molestie, sem eros viverra mauris, quis sollicitudin sapien enim nec est. ras pulvinar placerat diam eu consectetur.">
    <img class="last" alt="example7" src="./example/8_s.jpg" />
</a>
  • 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-08T17:40:02+00:00Added an answer on June 8, 2026 at 5:40 pm

    Declare a global variable on top of your javascript, e.g.

    var thisTitle;
    

    then use that variable to clone the title within your tooltip script (instead of this.t) like

    this.tooltip = function(){  
        $("a.tooltip").hover(function(e){                                             
            thisTitle = this.title;
            this.title = "";                                      
            $("body").append("<p id='tooltip'>"+ thisTitle +"</p>");
            $("#tooltip").fadeIn("fast");       
        },
        function(){
            this.title = thisTitle;        
            $("#tooltip").remove();
        }); 
        $("a.tooltip").mousemove(function(e){
            $("#tooltip")
    
        });         
    }
    

    In your fancybox custom script, use the titleFormat API option to pull the title from the thisTitle variable like

    $("a#example8").fancybox({
       "titlePosition": 'over',
       "titleFormat"  : function(){
          return '<span id="fancybox-title-over">'+thisTitle+'</span>'
        }
    });
    

    all together?

    <script type="text/javascript">
    var thisTitle;
    $(document).ready(function(){
     tooltip();
     $("a#example8").fancybox({
       "titlePosition": "over",
       "titleFormat": function(){
          return '<span id="fancybox-title-over">'+thisTitle+'</span>'
        }
     }); // fancybox
    }); // ready
    
    this.tooltip = function(){  
        $("a.tooltip").hover(function(e){                                             
            thisTitle = this.title;
            this.title = "";                                      
            $("body").append("<p id='tooltip'>"+ thisTitle +"</p>");
            $("#tooltip").fadeIn("fast");       
        },
        function(){
            this.title = thisTitle;        
            $("#tooltip").remove();
        }); 
        $("a.tooltip").mousemove(function(e){
            $("#tooltip")
        });         
    }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using fancybox to display some images. Currently when users hover the image,
I am using Fancybox plugin to display images in full screen when clicked., Is
I'm using FancyBox on my page, and occasionally (but not always), the lightbox opens
im using fancybox from: http://fancyapps.com/fancybox/ And the scroll pane is not working correctly and
Fist time using fancybox and it's not going so well.. starting to wish I
i am using fancybox function in jquery. i am opening loign box on click
I am using the fancybox.I want to display the image gallery using the galleria
I'm using Fancybox to display inline content (a div with an image linked to
I'm using Fancybox to load some content with AJAX. Content: <div class="container"> <h2>An image</h2>
We are using FancyBox 2.0/JQuery 1.7 in Internet Explorer 7 on http://www.tuxx.nl/spelling/werkwoorden/#print . When

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.