SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Weirdness

  1. #1
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Weirdness

    Hey,

    This might be some stupid mistake but I can't see it so here I am

    PHP Code:
    document.getElementById(menupane).innerHTML "<div align='center' valign='top' style='top: " bottom "; left: " left "; width: " 
                                                       
    menu.style.width "; height: 120px; z-index: 1'><b>Menu</b><br /><br />Hello :)</div>"
    That works great, no problems, but when I add a table to the inside to create rounded corners effect such as this
    PHP Code:
    document.getElementById(menupane).innerHTML "<div align='center' valign='top' style='top: " bottom "; left: " left "; width: " 
                                                          
    menu.style.width "; height: 120px; z-index: 1'><table width='100%' align='center'><tr>
                                                          <td><img src='pictures/PS/top-left-corner.gif' /></td><td bgcolor='skyblue'><b>Menu</b>
                                                          </td><td><img src='pictures/PS/top-right-corner.gid' /></tr><tr><td align='center' colspan='3'>
                                                          Option 1<br />Option 2<br />Option 3</td></tr><tr><td><img src='pictures/PS/bottom-left-corner.gif' />
                                                          </td><td bgcolor='skyblue'></td><td><img src='pictures/PS/bottom-right-corner.gif' /></tr></table></div>"

    I get an 'Unterminated string constant' error at page load and then when I try to activate that I get an 'Object expected' error.

    Any ideas??

    Thanks

  2. #2
    SitePoint Member
    Join Date
    Apr 2002
    Location
    New Zealand
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure you're allowed to have line breaks without breaking the sting.

    Try this:

    PHP Code:
    document.getElementById(menupane).innerHTML "<div align='center' valign='top' style='top: " bottom "; left: " left "; width: " 

                                                          
    menu.style.width "; height: 120px; z-index: 1'><table width='100%' align='center'><tr>" +

                                                          
    "<td><img src='pictures/PS/top-left-corner.gif' /></td><td bgcolor='skyblue'><b>Menu</b>" +

                                                          
    "</td><td><img src='pictures/PS/top-right-corner.gid' /></tr><tr><td align='center' colspan='3'>" +

                                                          
    "Option 1<br />Option 2<br />Option 3</td></tr><tr><td><img src='pictures/PS/bottom-left-corner.gif' />" +

                                                          
    "</td><td bgcolor='skyblue'></td><td><img src='pictures/PS/bottom-right-corner.gif' /></tr></table></div>"
    Might also want to change "top-right-corner.gid" to "top-right-corner.gif".
    Abhishek

  3. #3
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Might also want to change "top-right-corner.gid" to "top-right-corner.gif".
    Could help

    I didn't intend for line breaks, I just did that for easier to read code. Your code works!! Thanks


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
  •