SitePoint Sponsor

User Tag List

Results 1 to 1 of 1
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2005
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Parsing setStyleByTag in Select Menu

    Hello,
    Can someone please help me to get this thing
    going? I can't get the select menu to work.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>buiBase Content Management System</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="Keywords" content="buiBase" />
    
    
    
    
    <!-- MUST BE ABOVE SPECIFIED CSS STYLESHEET (SEE BELOW) -->
    <script type="text/javascript" src="http://sirmikey.com/scripts/styley.js"></script>
    <!-- SPECIFIED TAGs BELOW -->
    
    <style type="text/css">
    body {
    margin:0;
    padding:0;
    font-family: Verdana,Tahoma,Arial,sans-serif;
    text-align:left;
    background-color:#cccccc;
    }
    
    -->
    </style>
    
    
    </head>
    <body>
    <div class="wrap">
    
      // setStyleByTag: given an element type, style property and <br />
        // value, and whether the property should override inline styles or<br />
        // just global stylesheet preferences, apply the style.<br />
        // args:<br />
        //  e - element type or id<br />
        //  p - property<br />
        //  v - value<br />
        //  g - boolean 0: modify global only; 1: modify all elements in document<br />
     
      <br />
     <br />
      function setStyleByTag(e, p, v, g)
      <div class="font-family_black">
       <form action="#" id="familyform">
    <select name="#" class="pullfamily" 
    onchange="setStyleByTag("body", "fontFamily", "(this.options[this.selectedIndex].value)",1);">
          <option value="Times, serif">Times</option>
          <option value="Courier, monospace">Courier</option>
          <option value="monospace, courier">Monospace</option>
        </select>
      </form>
    </div>
    <!-- close font_family -->
    Script Source Code: <a href="http://www.oreillynet.com/javascript/2001/10/05/examples/styley_source.txt" target="_blank" title="Home">HERE</a>
    
    <br />
    Verify Script Working: setStyleByTag: <br />
    <a onClick='setStyleByTag("body","fontFamily","Times, serif",1);' href="#" title="Home">Font: Times</a><br />
    <a onClick='setStyleByTag("body","fontFamily","Courier, monospace",1);' href="#" title="Home">Font:Courier</a><br />
    <a onClick='setStyleByTag("body","color","blue",1);' href="#" title="Home">Switch blue</a><br /> <a onClick='setStyleByTag("body","color","red",1);' href="#" title="Home">Switch red</a><br /> <a onClick='setStyleByTag("body","color","black",1);' href="#" title="Home">Switch black</a>
    <br />
    
    
    </div>
    <!-- end wrap -->
    </body>
    </html>
    Thanks in advance,
    myst...
    Last edited by myst59; Sep 9, 2007 at 13:53.


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
  •