Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Senior Member shoffman3572's Avatar
    Join Date
    Jul 2008
    Location
    Fullerton, CA
    Posts
    137
    Member #
    16990
    I'm creating a forum (for dancers) and want to show a brief description of the main posters comment in a div element near the mouse pointer as they hover over each forum title - that way, they can get a preview of the forum before deciding to click, and view the complete list of posts for that forum.

    I have this working the way i want in IE, Safari and Chrome - but in Firefox, I'm getting a 'Event is Not Defined' error..

    function getForumText(text)
    {

    objPopUp = document.getElementById('popUpMessage');
    objPopUp.innerHTML="" + text + "";
    objPopUp.style.marginTop = getPosition(event).y - 170 + "px";
    objPopUp.style.visibility = 'visible';
    return;
    }
    so - the getForumText function is called by a onmouseover as the users mouse hovers over the forum title.

    getPosition(event) calls:

    function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
    cursor.x = e.pageX;
    cursor.y = e.pageY;
    }
    else {
    var de = document.documentElement;
    var b = document.body;
    cursor.x = e.clientX +
    (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
    cursor.y = e.clientY +
    (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    return cursor;
    }

    Any ideas why this isn't working in Firefox?

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    Any reason you're not simply using the "title" attribute of the appropriate element to have a tooltip show up?

    If you don't care about IE6 (and even then there's a workaround) you can do this entirely in CSS too using the :hover pseudoclass.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:50 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com