CyberiaPC.com Community Forums Main Page
RSS Feeds: Late(st) News | Zenith Picture Gallery | Most Recent Community Topics | Tips, Tricks and Other Useful Stuff

Welcome Guest ( Log In | Register )

Reply to this topicStart new topic
> [Request] expandable/shrinkable categories
Usher
post Apr 27 2008, 05:52 PM
Post #1


New Member
*

Group: Members
Posts: 24
Joined: 7-April 08
Member No.: 9,602

United States




Ok, so I've been racking my brain for well over a week now on how to do this, and in the process have learned more javascript than I'd like to have.....but I've come up with a UGLY and only partially working piece of concept code to make sorting through categories a bit easier (I've got dozens, and it's annoying at least for me to sort though).
I'd love to have something to the effect of DeviantArt's category picker, but that's probably some outrageous code.
I had two areas I was focusing on.
1. The 'Browse' page (display.php) - Allowing the main categories to show by default, and expand as you click on their row.
This I have working to a degree, it seems glitchy, and doesn't close up properly because I forgot to pass in a 'closing or opening' condition.
2. The categories dropdown on many pages (f_cats.php) - Something more manageable than a 100 category dropdown.....
This I attempted to get working as a <select multiple> but the closest thing I got to working had tons of gaping holes.....not the goal

This required some in-depth breaking of code, and I'm not happy with the result, but I'm still an amateur at php and javascript, so maybe you can grow this concept beyond what I've done.

Just FYI, the javascript I've made works pretty darn well for almost anything to be accordion'ed.
Format:
All things below the clickable must be at sibling or child level to it
Each header must contain 'class="open beginsub" onclick="test(this, 0)" style="display:"' in order to operate
Each item in the subgroup must contain either 'class="open"' or 'class="close"'
The final item in the subgroup must contain "class="open/close endsub"

Don't have to be the same type of object, don't have to have id's....just those classes, and the clickable on headers.....kinda cool and really simple.
Needs to have a 'close all subgroups below me' flag sent in, that gets set on the first click when you decide whether to open or close, otherwise closed subgroups get opened and opened subgroups get closed, regardless of the status of the header.

So let me know what you think, and how we could improve. (and DO NOT FORGET to back things up before making these changes, they're poorly tested)

~Usher
Attached File(s)
Attached File  expand.diff.txt ( 11.6K ) Number of downloads: 134
 


--------------------
-------------------
Everyone told me I was daft to build a castle on a swamp! So I did.
~Usher
Go to the top of the page
 
+Quote Post
SvetaInhipKig
post Mar 16 2010, 12:27 AM
Post #2


New Member
*

Group: Members
Posts: 4
Joined: 12-January 10
From: Россия
Member No.: 12,015

Nothing Selected




Hi Guys,
We know that the gallery is not very properly categorized . So if you want it to have more categories which we have not thought of , or if you have pictures which go to a particular category which is absent now, please mention it here and we will create it Asap.


--------------------
Тут обычно покупаю детские фильмы
и другие товары
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th June 2013 - 12:34 PM