/    Sign up×
Community /Pin to ProfileBookmark

Expanding Categories

I was wondering how you did expanding categories, like in thie forum when you click the arrow type button and it collapses the forum topic/category.

thanks in advance for your help.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterJul 15.2005 — <i>
</i>&lt;script type="text/javascript"&gt;
function toggleMenu(){
var e=document.getElementById("menu1")
if(e.style.display=="none"){
e.style.display="block"
}
else{
e.style.display="none"
}

}
&lt;/script&gt;
&lt;img src="http://www.webdeveloper.com/forum/images/misc/menu_open.gif" onclick="toggleMenu()"&gt;
&lt;div id="menu1"
style="display:none;background-color:rgb(173,216,230);color:blue;position:absolute;left:30px;top:30px;z-index:555555;"&gt;
Hello World
&lt;/div&gt;
Copy linkTweet thisAlerts:
@patrickjauthorJul 15.2005 — hey thnks, lol looks kind of complicated though, oh well, also whats the HTML/XHTML side to this?
Copy linkTweet thisAlerts:
@bathurst_guyJul 15.2005 — Actually looks like one of the simplier scripts I've seen, and the HTML is there too
Copy linkTweet thisAlerts:
@UltimaterJul 15.2005 — If you want full HTML:
<i>
</i>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 STRICT//EN" "http://www.w3.org/TR/HTML401/strict.dtd"&gt;
&lt;html dir="ltr" lang="en"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
&lt;meta http-equiv="Content-Style-Type" content="text/css"&gt;
&lt;meta http-equiv="Content-Script-Type" content="text/javascript"&gt;
&lt;base href="http://www.webdeveloper.com/forum/images/misc/"&gt;
&lt;title&gt;example&lt;/title&gt;
&lt;script type="text/javascript"&gt;
function toggleMenu(){
var e=document.getElementById("menu1")
if(e.style.display=="none"){
e.style.display="block"
}
else{
e.style.display="none"
}

}
&lt;/script&gt;
&lt;style type="text/css"&gt;
#menu1{
display:none;
background-color:rgb(173,216,230);
color:blue;
position:absolute;
left:30px;
top:30px;
z-index:555555;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;
&lt;img src="menu_open.gif" onclick="toggleMenu()" alt=" "&gt;
&lt;div id="menu1"&gt;
Hello World
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;



edit: passed the HTML Validator test.
×

Success!

Help @patrickj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...