Results 1 to 7 of 7

Thread: ToolTip CSS

  1. #1
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default ToolTip CSS

    http://www.dynamicdrive.com/dynamici...tmltooltip.htm

    The script allows you to position the tooltip using the 'X and Y' attributes. This works fine.

    The CSS looks like a normal CSS code.. it should allow you to add Background images, padding and so on..

    The problem: I've added a background image to my tooltip. I presume that the rule for the background image would be simple, i.e, background image remains in position regardless of padding. However, when I add the padding to the tooltip CSS, it seems to move the actual tooltip itself. (as if I'm changing the 'X and Y' attributes. The problem result is that I cannot seem to be able to center my text inside the tooltip.

    Any suggestions?

    Thanks all.

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Please provide us a link to the page in question.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hi Rangana,

    The link: http://cloodo.com/index1.php

    The linked text is the blurp in bold letter in the top center area. The first linked text tooltip contains text, the other 2 are empty.. you will see the disposition of the text. I hope you can work it out and help me out coz I'm just about given up.

    Thanks again.

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    Change the highlighted:
    Code:
    onMouseover="ddrivetip('<span>Your universe is made of the people and things that
    to (default) block level element (<p>, <div>). Let's try <p> element.
    Code:
    onMouseover="ddrivetip('<p>Your universe is made of the people and things that
    Also, do the same on its closing tag:
    Code:
    with everyone.</span>')" onMouseout="hideddrivetip()">
    Change the highlighted to </p>.

    Now, it's time to play on CSS. Add the highlighted on your <p> tag:
    Code:
    <p class=\'rangJust\'>
    ...and in your CSS, add this:
    Code:
    .rangJust
    {
    padding:45px 30px; /* Padding of element having class name rangJust (top right bottom left) */
    }
    See if it helps.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. #5
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thank you Rangana.. The fix works.. I added a credit on the CSS code.

    (note: I have tried allocating a css class to the text before but it didn't work.. What I did was <span class="textClass">.. Obviously, when this is substituted with your <p class=\'textClass\'> it works perfectly.. I am not sure if it is the <span> tag, or, the class inside it (\'textClass\'), or, both. I need to learn more about the difference between (class="someClass") and <class=\'someClass\').

    Many Thanks

  6. #6
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    To explain the difference:

    class="someClass" is the normal look on markups, but since we are feeding the contents to JS, we have to escape the quotes, or else, the script will throw an error. Thus the result of adding the highlighted:
    Code:
    class=\'someClass\'
    Hope that makes sense
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  7. The Following User Says Thank You to rangana For This Useful Post:

    cloodo (07-02-2008)

  8. #7
    Join Date
    Jul 2008
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks again Rangana..

    Yes that makes sense.

    (Cebu is one of my favorite holiday spots.. beaches, night clubs and lots of fun).

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •