Results 1 to 3 of 3

Thread: [RESOLVED] 2 Pieces of HTML5 with Tooltip. One works the other doesn't

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    91

    Resolved [RESOLVED] 2 Pieces of HTML5 with Tooltip. One works the other doesn't

    I am hoping that one of you keen-eyed people out there will be able to tell me what is wrong with this code. I have a number of these <articles> created dynamically from a desktop application. They are laid out on the page according to their birth positions in family which is why the absolute position is different.

    The first <article> works perfectly and the second piece fails to show any tooltip.

    Code:
    <article id='aparent' onmouseover="Tip('<b>Born:</b>Colchester, Essex<br><b>Died:</b>Not Known<br><b>Work:</b>Not Known')" onmouseout="UnTip()" style='position:absolute;margin-left:12px;margin-top:120px;background-color:MistyRose'>
    <img style='border:none;float:left'; id='mugshot' src='images/smallfemale.png'>
    <div class='name' style='' >Elizabeth Kate PITT (216)</>
    <div class='born' style='padding-top:10px;'><b>Born: </b>abt 1885</>
    <div class='died' style='padding-top:10px;'><b>Died: </b></>
    </article>
    
    <article id='aparent' onmouseover="Tip('<b>Born:</b>St. John's Moulsham, Chelmsford<br><b>Died:</b>Not Known<br><b>Work:</b>Not Known')" onmouseout="UnTip()" style='position:absolute;margin-left:12px;margin-top:230px;background-color:LightCyan'>
    <img style='border:none;float:left'; id='mugshot' src='images/smallmale.png'>
    <div class='name' style='' >Charles Frederick PITT (98)</>
    <div class='born' style='padding-top:10px;'><b>Born: </b>ABT 1891</>
    <div class='died' style='padding-top:10px;'><b>Died: </b></>
    </article>
    There has to be something different but I can't see what it is, can you?

    Cheers
    Penfound

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,537

    Re: 2 Pieces of HTML5 with Tooltip. One works the other doesn't

    you broke the string:
    Code:
    Tip('<b>Born:</b>St. John's Moulsham,
    See the 's after John? that tick marked closed out the string... so the only thing that got passed to the Tip function was "<b>Born:</b>St. John" ... the rest of the line fell out of the string, probably generating a javascript error, and then when it hot the ' after "Not Know" at what should have been the end of the string, it actually had the reverse effect....

    Bottom line, if you need tick marks in a string in js, you need to escape them:
    Code:
    <article id='aparent' onmouseover="Tip('<b>Born:</b>St. John\'s Moulsham, Chelmsford<br><b>Died:</b>Not Known<br><b>Work:</b>Not Known')" onmouseout="UnTip()" style='position:absolute;margin-left:12px;margin-top:230px;background-color:LightCyan'>
    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2013
    Posts
    91

    Re: 2 Pieces of HTML5 with Tooltip. One works the other doesn't

    Thank you so much. A case of not seeing the wood for the trees.

    Penfound

Posting Permissions

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



Click Here to Expand Forum to Full Width