<?xml version="1.0"?> 
<rdf:RDF 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns="http://purl.org/rss/1.0/">  
  <channel rdf:about="http://beta.twelvestone.com/forum_thread/view/31411">
    <title>RSS: Change CSS class/style with Javascript.</title>
    <description>Last twenty posts from Change CSS class/style with Javascript.</description>
    <link>/forum_thread/view/31411</link>
    <items>
      <rdf:Seq>	
  
        <rdf:li 
	   resource="http://twelvestone.com/forum_thread/view/31411#495494" />
  
        <rdf:li 
	   resource="http://twelvestone.com/forum_thread/view/31411#495480" />
  
        <rdf:li 
	   resource="http://twelvestone.com/forum_thread/view/31411#495464" />
  
        <rdf:li 
	   resource="http://twelvestone.com/forum_thread/view/31411#495355" />
  
        <rdf:li 
	   resource="http://twelvestone.com/forum_thread/view/31411#495331" />
  
      </rdf:Seq>      
    </items>
  </channel>  
   
  
  <item rdf:about="http://twelvestone.com/forum_thread/view/31411#495494">
    <title>Reply by Flip 2006.06.26, 04:16PM</title>
    <description><![CDATA[ Yeah... it does indeed rock... The reason for me looking for it was to hide any flash elements when a special CSS layer shows up over top of everything. I can switch the visibility of any flashDiv to hidden. ]]></description>
    <link>http://beta.twelvestone.com/forum_thread/view/31411#495494</link>
    <dc:date>2006-06-26T16:16:18+00:00</dc:date>
  </item>
  
  <item rdf:about="http://twelvestone.com/forum_thread/view/31411#495480">
    <title>Reply by DontBogartMe 2006.06.26, 03:36PM</title>
    <description><![CDATA[ nice one.<br /><br />*lives*<br />*learns* ]]></description>
    <link>http://beta.twelvestone.com/forum_thread/view/31411#495480</link>
    <dc:date>2006-06-26T15:36:28+00:00</dc:date>
  </item>
  
  <item rdf:about="http://twelvestone.com/forum_thread/view/31411#495464">
    <title>Reply by Flip 2006.06.26, 02:45PM</title>
    <description><![CDATA[ Well after about 10 to 12 hours of searching, reading, and tinkering I've done it! I am CSS/JS code Ninja today!<br /><br /><br />Here is a <a target="_blank" href="http://www.pjbstudios.com/temp/css_test.html">working example</a>.<br /><br /><br />The JS code used is as follows:<br /><div class="code-block"><pre><br />&lt;script language="JavaScript"&gt;<br />function changeRule(theNumber) {<br />	var theRules = new Array();<br />	if (document.styleSheets[0].cssRules) {<br />		theRules = document.styleSheets[0].cssRules;<br />	} else if (document.styleSheets[0].rules) {<br />		theRules = document.styleSheets[0].rules;<br />	}<br />	theRules[theNumber].style.backgroundColor = '#FF0000';<br />}<br />&lt;/script&gt;<br /></pre></div><br /><br />I've tested this on FF(Mac), Safari(Mac), O9(Mac), IE5(Mac), IE6(PC), FF(PC) and they all work. The reason for the 'if' statement is some of the browsers use cssRules... some use just rules... And the only other hair is that you can't use "background-color" to refer to the style, you have to get rid of the hyphen and capitalize the first letter after the hyphen.<br /><br />To refer to the first CSS rule you'd use "changeRule(0)", the second "changeRule(1)" and the third "changeRule(2)" and so on...<br /><br /><br />I haven't found a browser it doesn't work on.... yet.... ]]></description>
    <link>http://beta.twelvestone.com/forum_thread/view/31411#495464</link>
    <dc:date>2006-06-26T14:45:45+00:00</dc:date>
  </item>
  
  <item rdf:about="http://twelvestone.com/forum_thread/view/31411#495355">
    <title>Reply by DontBogartMe 2006.06.25, 08:50AM</title>
    <description><![CDATA[ as far as I know (which isn't very far with JavaScript...) JS cannot change the CSS rules for a doc at all - so you need another plan.<br /><br />What you need is to get all the elements (the DIVs the Ps the SPANs etc) that have a specific class into an array - then you loop through that array and make each element visible (or set it to another class or whatever else).<br /><br />There seem to be a number of functions out there called getElementsByClassName or something similar that will get you that array.<br /><br />Here's one - <a target="_blank" href="http://www.snook.ca/archives/000370.php"><a target="_blank" href="http://www.snook.ca/archives/000370.php">snook.ca/archives/000370.php</a></a><br />I haven't tried it myself, just found it in Google. ]]></description>
    <link>http://beta.twelvestone.com/forum_thread/view/31411#495355</link>
    <dc:date>2006-06-25T08:50:06+00:00</dc:date>
  </item>
  
  <item rdf:about="http://twelvestone.com/forum_thread/view/31411#495331">
    <title>Reply by Flip 2006.06.24, 11:19PM</title>
    <description><![CDATA[ Okay, I'll try to explain this as simply as possible. I want to, dynamically, most likely with a javascript function, change the properties of a CSS style. Currently, I've crafted some code that will allow me to change/apply a style to a specific DIV -- targeting the ID of it. This is great...<br /><br />Here is a sample of the code:<br /><div class="code-block"><pre><br />&lt;style type="text/css"&gt;<br />&lt;!--<br />.theStyle {<br /><br />	width: 150px;<br />	height: 150px;<br />	visibility: hidden;<br />	background-color:#CCCCCC;<br />}<br />--&gt;<br />&lt;/style&gt;<br /><br />&lt;script language="JavaScript"&gt;<br />	function makeVis(divID) {<br />		document.getElementById(divID).style.visibility = "visible";<br />	}<br />&lt;/script&gt;<br /><br />&lt;div id="theDivNameOne" class="theStyle" align="center"&gt; The First Div &lt;/div&gt;<br />&lt;div id="theDivNameTwo" class="theStyle" align="center"&gt; The Second Div &lt;/div&gt;<br /><br />&lt;a href="javascript:makeVis('theDivNameOne');"&gt;Make One Visible&lt;/a&gt; | &lt;a href="javascript:makeVis('theDivNameTwo');"&gt;Make Two Visible&lt;/a&gt;<br /></pre></div><br /><br />When I click 'Make One Visible' it will make 'theDivNameOne' show up. The second will stay hidden. And the same works with 'Make Two Visible'.<br /><br /><br /><br /><br />Now here comes the part I can't figure out.<br /><br />I want to change the style by targetting the actual style/class that is specified in the CSS code -- not by targetting the actual DIV. So if I could do something like:<br /><br /><div class="code-block"><pre><br />&lt;a href="javascript:makeVis('theStyle');"&gt;Make Them ALL Visible&lt;/a&gt;<br /></pre></div><br /><br />Any DIV, SPAN, P or anything that has 'class="theStyle"' applied to it, will change... It actually changes the class/style rather than changing the class/style of a specific item.<br /><br /><br /><br />Any ideas? ]]></description>
    <link>http://beta.twelvestone.com/forum_thread/view/31411#495331</link>
    <dc:date>2006-06-24T23:19:59+00:00</dc:date>
  </item>
  
  
</rdf:RDF>
