flfmmqp
asked on
Working with Layout
I am going to have several sectons on my webpage that I would like to allow the user to be able to maximize and minimize them as needed. In otherwords allow them to see only what they care to see. I am using Visual Studio 2005. The quickest example I know of is the experts-exhange "Welcome Premium Service Member" where you can minimize and maximize that section.
How can I do this without buying expensive software. Should this be in the visual interdev section?
How can I do this without buying expensive software. Should this be in the visual interdev section?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Less typing is nice; the basic idea is still the same though. There was an error in the new code.
el.style.display = (el.style.display == 'none') ? '' : 'none';
The closing parentheses needs to be after the "if" and before the question mark character. That method is a simplified if statement and a great suggestion for simplifyng.
There is one other problem, I believe, that was in the original code. I overlooked it since I thought this was more about concept. Arrays or collections in Javascript used the square brackets instead of parentheses. You probably need to make change like below in the hideall() function. I will correct your original code but you could make the same change in the simplified code suggested above.
function hideall() {
for (i=0;i<document.getElement sByTagName (hiddenCon tentElemen t).length; i++) {
if(document.getElementsByT agName(hid denContent Element)[i ].classNam e == hiddenContentClass){
document.getElementsByTagN ame(hidden ContentEle ment)[i].s tyle.displ ay="none";
}
}
}
Hopefully the recent post will bring this back to life. Let us know if you have a question or need more info.
bol
p.s. Since were simplifying the script tag should just be ...
<script type="text/javascript">
The language property/attribute is deprecated.
el.style.display = (el.style.display == 'none') ? '' : 'none';
The closing parentheses needs to be after the "if" and before the question mark character. That method is a simplified if statement and a great suggestion for simplifyng.
There is one other problem, I believe, that was in the original code. I overlooked it since I thought this was more about concept. Arrays or collections in Javascript used the square brackets instead of parentheses. You probably need to make change like below in the hideall() function. I will correct your original code but you could make the same change in the simplified code suggested above.
function hideall() {
for (i=0;i<document.getElement
if(document.getElementsByT
document.getElementsByTagN
}
}
}
Hopefully the recent post will bring this back to life. Let us know if you have a question or need more info.
bol
p.s. Since were simplifying the script tag should just be ...
<script type="text/javascript">
The language property/attribute is deprecated.
bol: right you are. It's these @#$% fingers...
Badotz - LOL. I know what you mean. By the end of the day the Backspace key is the one that gets the most use. If your post revitalizes this and gets the Asker to close/comment then it is worth it. :)
bol
bol
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
ASKER
<script language="javascript" type="text/javascript">
<!--
var hiddenContentClass = "extra";
var hiddenContentElement = "tbody";
function flip(e) {
if (document.getElementById(e
document.getElementById(e)
} else {
document.getElementById(e)
}
}
function hideall() {
for (i=0;i<document.getElement
if(document.getElementsByT
document.getElementsByTagN
}
}
}
window.onload = function() {
hideall();
};
// -->
</script>