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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:48:09+00:00 2026-05-13T15:48:09+00:00

function tip(evt,s){ $(‘p#vtip’).show(); xOffset = -10; // x distance from mouse yOffset = 10;

  • 0
function tip(evt,s){
        $('p#vtip').show();

        xOffset = -10; // x distance from mouse
        yOffset = 10; // y distance from mouse 
        top = (evt.pageY + yOffset); 
        left = (evt.pageX + xOffset);

        var str = $(s, "> #content").html();
        $('p#vtip #content').html(str);
        $('p#vtip').css("top", top+"px").css("left", left+"px").fadeIn("slow");
}

In Firefox everything is OK.

However, in Chrome, and Internet Explorer 8, it is always in the bottom:

This is HTML:

<div>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
     <span onmouseover="tip(event,this);">程序错误<div id="content">good</div></span><br>
    </div>

<p id="vtip" style="position:absolute"><img id="vtipArrow" src="vtip_arrow.png" />testtest<span class="content"></span></p>
  • 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-13T15:48:10+00:00Added an answer on May 13, 2026 at 3:48 pm

    If you’re using jQuery, you may want to take a different approach for your event handling.

    First, change id="content" to class="content". IDs must be unique, and will cause problems if you refer to them more than once in your HTML. Classes can be used multiple times.

    Second, if you’re using jQuery, you might as well have it take care of assigning event handlers. Notice that I removed your ‘onmouseover’ statements.

    I also gave an ID to the div that contains the spans.

    <div id="container">
         <span>程序错误<div class ="content">good</div></span><br>
         <span>程序错误<div class ="content">good</div></span><br>
         <span>程序错误<div class ="content">good</div></span><br>
         <span>程序错误<div class ="content">good</div></span><br>
    
        </div>
    

    Next, in your jQuery javascript, assign the ‘mouseover’ event like this:

    $('document').ready(function() {
    
        $('#container span').bind('mouseover', function(evt) {
            $('p#vtip').show();
    
            var xOffset = -10; // x distance from mouse
            var yOffset = 10; // y distance from mouse 
            var top = (evt.pageY + yOffset); 
            var left = (evt.pageX + xOffset);
    
            var str = $(this).children('.content').html();
            $('p#vtip .content').html(str);
            $('p#vtip').css({top: top}).css({left: left}).fadeIn("slow");
        });
    
    });
    

    This will assign the mouseover event to all spans that are a child of #container. You refer back to the element with the handler via ‘this’, or $(this) if you want to use jQuery functions.

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

Sidebar

Related Questions

I want show my tool tip after 5 second mouse enter. I try following
CREATE OR REPLACE PACKAGE packet AS TYPE tip IS RECORD(a1 INT,a2 VARCHAR2(20)); FUNCTION getrow
$('.selector').qtip({ content: { text: function(api) { return $(this).children('.tip').clone(); } }, style: { classes: 'ui-tooltip-rounded',
I Want to show tool tip on a column of cells which is being
I have a function for creating a tooltip from a title. I am trying
I've got the tool tip to show the number of Twitter followers but it
here is my case: <html> <body> <head> ... <script> $(function(){ $('.do-tip').qtip({ content: 'This is
Can you call a function as an object? For example: function Tip(txt){ this.content =
Why does delay() work here: $('#tipper').mouseout(function() { $('#tip').delay(800).fadeOut(100); }); But this fails to delay:
All, var a='<div id=details onmouseover=tip(this)>'; function tip(el) { $(this).mouseover(function() { var b=<div id='test'>+el.innerHTML+</div>; $(b).css(display,

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.