| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Senior Member Join Date: Oct 2003
Posts: 3,472
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | collapsing menu Im working on the menu at my site http://tutorialhit.com/index.php i want to be able to click the main category (in this case, only one is there, and called PHP coding) and it would display all of the sub-categories in only that category (there will be more main categories added). Then if you click the PHP coding category again, the sub-categories go away again. The categories are all in the mysql database This is the code for the subcategories PHP Code: If i know the code on how to make you click on a link and gives text to a certain variable but the page doesnt reload or something, then i can probably do it. Ie PHP Code:
__________________ hostvouchers - Coupons and Reviews for the top web hosts! (shared, reseller, vps, servers, adult, offshore, proxy)
Last edited by killaklown; 06-21-2006 at 12:20 PM.
|
| |
| | #2 (permalink) |
| NamePros Regular Join Date: Dec 2005 Location: Derbyshire, UK
Posts: 887
![]() ![]() ![]() ![]() | These three links should help, I think they are what you are after: http://www.dynamicdrive.com/dynamici...switchmenu.htm http://www.dynamicdrive.com/dynamici...witchmenu2.htm http://www.dynamicdrive.com/dynamicindex1/navigate2.htm The first is almost the same as the demo you posted. The second is similar, but has a smoother effect. The third is like the first, but allows more information. |
| |
| | #4 (permalink) |
| Resistance is Futile Join Date: Apr 2006 Location: Montreal, Canada
Posts: 1,094
![]() ![]() ![]() ![]() ![]() ![]() | I'm trying to figure out how to implement it into the PHP, but here's the Javascript: Code: <script type="text/javascript">
function showList(element) {
if (document.getElementById(element).style.visibility == "collapse") {
document.getElementById(element).style.visibility = "visible";
} else {
document.getElementById(element).style.visibility = "collapse";
}
}
</script> PHP Code:
__________________ Freelance Web Developer PHP, MySQL, XHTML, CSS, Javascript, jQuery, Wordpress Portfolio: www.bundy.ca |
| |