Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts

    How to Specify Width in a Popup Box?

    Hi,

    In a previous thread, I was provided with the following, very useful code for having a "Target" word or phrase highlighted in yellow, where the "Text here" message pops up in a box when the cursor moves over the target word.

    Code:
    <span style="background-color: yellow" TITLE="
    Text here.
    ">Target</span>
    I was wondering if code can be added to specify the width of the pop-up box. The default seems to be for the box to be much wider than I would like.

    Thanks,
    Bill

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello BSquared18,
    It would be easy to style your tooltip from the CSS instead of using inline styles like your example.

    Some tooltips here.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    22
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks for the tip, but for my purposes the code I showed is working well, and CSS isn't necessary.

    Still would like someone to suggest how to specify the box width in the code. Pretend you are talking to someone who needs it spelled out, because that's the case!

    Thanks,
    Bill

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    I see what you're doing... and I spoke too soon. There is no way to style the box that pops up with the title text in it.

    There are some alternatives though -
    http://www.dynamicdrive.com/dynamici...tmltooltip.htm
    http://craigsworks.com/projects/qtip/docs/
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,630
    Thanks
    0
    Thanked 648 Times in 638 Posts
    There's no way to style it because not all browsers pop it up in a separate box. Some browsers display the text in the status bar instead.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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