SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot Tikila's Avatar
    Join Date
    Jun 2007
    Location
    Toronto
    Posts
    173
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    please help me if you can,am stuck with this "simple" js code

    am bad at js

    I want to show this content to resolution equal or bigger than 1024.
    Can anyone tell me what am i doing wrong,please ?
    thank you

    Code:
    <script language="JavaScript" type="text/javascript"> 
    if(screen.width>=1024) 
    {document.write("<div class=\"Rightform\">
    <div class=\"center"\> 
    <a href=\"http://testsite.com/t/5567679/\"><img src=\"http://testsite.com/123/\" alt=\"logo\" border=\"0\"></a>
    <p class=justify><span class=\"bold\"> -- registered users only --</span><br />
    blah blah blah.<br />
    -- Click here for more info -<br />
    <span class=\"red\">************</span>
    </p>
    </div>
    </div>");
    } 
    </script>

  2. #2
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All element attribute values should be in quotes.

    <p class=justify>

    should be

    <p class=\"justify\">

    Also, post any error messages you're getting in the browser. This will help narrow down the problem, as opposed to just guessing at it.

    EDIT: By the way, those class attributes won't do anything unless the classes are defined in a stylesheet.


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
  •