Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 12-14-2004, 04:21 PM   #1 (permalink)
Insane
 
aa1037's Avatar
 
Location: New York
[JavaScript] help with what a section of code means

I'm doing an assignment for my web design class and there is a chunk of code I need to describe and I'm not quite sure what is going on in it.

Code:
function makeappear() {
if (document.getElementById('row2').style.display == ") {
      document.GetElementById('row2').style.display = 'none';
} else {
      document.getElementById('row2').style.display = ";
}
Thanks in advance!
aa1037 is offline  
Old 12-14-2004, 04:53 PM   #2 (permalink)
Crazy
 
Quote:
Originally Posted by aa1037
I'm doing an assignment for my web design class and there is a chunk of code I need to describe and I'm not quite sure what is going on in it.

Code:
function makeappear() {
if (document.getElementById('row2').style.display == ") {
      document.GetElementById('row2').style.display = 'none';
} else {
      document.getElementById('row2').style.display = ";
}
Thanks in advance!
document.getElementByID('row2').style.display
This line finds the 'display' property of the 'style' field in an element named 'row2' somewhere in the 'document'. 'Document' being the webpage the script was run on. 'row2' 'element' being something that a 'style' field can be applied to such as a <div> tag or a <a> tag or a <p> tag. 'Display' being a property of the 'style' field which indicates the current status of the 'element'- whether it's visible or not.

if (document.getElementById('row2').style.display == ")
document.GetElementById('row2').style.display = 'none';

If the display property is equal to whatever " represents then set the display property to equal 'none'. When the display property is none, then the element is not drawn. For example: If perhaps, the element was a <div>, then everything in between the <div name=row2></div> tags would be invisible.

} else {
document.getElementById('row2').style.display = ";

If the display field did not equal 'none' then we set the display field to equal whatever " represents.
Robaggio is offline  
Old 12-14-2004, 08:07 PM   #3 (permalink)
Insane
 
aa1037's Avatar
 
Location: New York
thanks so much man! makes lots more sense now
aa1037 is offline  
 

Tags
code, javascript, means, section


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 06:07 AM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73