| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| Sliding Category Hider; ZetaBoards type collapse/expand code | |
|---|---|
| Topic Started: Mar 14 2008, 12:15 PM (1,698 Views) | |
| Mwr247 | Mar 14 2008, 12:15 PM Post #1 |
|
Cęsaris Salutis!
|
Name: Sliding Category Hider Description: Yet another result of the BB coding contests: A category expand/collapse code, but with an awesome sliding effect. Saves your preferences for each category. It works alot like the ZetaBoard expand/collapse code, but with 3 major differences (besides the fact that it's for InvisionFree): 1: While the ZetaBoard code slides open and closed normally, if you refresh the page while it's closed, it has to completely reload to open again (no sliding effect). This one always slides. 2: The ZetaBoard code only slides in FireFox and other like browsers, not in IE. This code has been tested to work in every major browser (read compatibility below). 3: The ZetaBoard code only works for registered members. This code works for everyone. Copyright: Mwr247 Browser compatibility: FireFox, Internet Explorer, Opera, Safari, Netscape, Mozilla. Known Bugs: - Opening/closing multiple categories at once will cause ones that have not yet opened/closed to stall. Clicking again fixes it. Preview/Screen shot: http://z15.invisionfree.com/Mwr247/ (new board for new codes, RSP was running slow XD) Installation: Throw this below the <% BOARD %> tag in your board wrappers: That's all there is to it. Hope you enjoy
Edited by Mwr247, Feb 14 2009, 10:54 PM.
|
![]() |
|
| atrimalous | Mar 14 2008, 01:08 PM Post #2 |
|
Legendary battousai
|
dude, pretty friggin neat. i like it. how'd you do it?.. btw, you said it like slides, and that it differs from zeta because of that. well, when i was looking at it. its didnt really slide, well it did, but alright well bleh but anywho, i dont really think differs that much from zeta, zeta's closes alot faster, almost instantly, while yours closes at a slower rate thus giving off the "i slide" effect. but an way, i like it. dfinately worthy of note. 10/10 |
![]() |
|
| Mwr247 | Mar 14 2008, 01:13 PM Post #3 |
|
Cęsaris Salutis!
|
It loops a delayed function that decreases the height by a certain number of pixels, up to a set point. Clicking again does the same in reverse. I could set it up to go faster, but then it appears to be less smooth (which I wanted to show off like you said), so I found this to be at an optimum range. You are right though, it is a bit slowish, so I'll speed it up a little more when I get back tonight. Still, glad you like it
|
![]() |
|
| atrimalous | Mar 14 2008, 01:30 PM Post #4 |
|
Legendary battousai
|
ohhh, wel that makes sense. i still like it alot though. you shoudl speed it up by about 1 second. cause i assume it takes about, 2 seconds right now. (i cant count it) so i say speed it up by abot 1 second.. i was gona post the edited version of that one part of the code, but i cant even see the source code for our code.when i type it up it says "cannot display page, there are too many errors in this .gif" and i was like "wha...". so yeh. but anyway. still a great code. |
![]() |
|
| Mwr247 | Mar 14 2008, 01:42 PM Post #5 |
|
Cęsaris Salutis!
|
Turns out my meet was canceled, so I went ahead and made the changes now. As for the speed, it's not so much changing the time as it is changing the distance jumped. The code cycles the function at a rate of 1/100th of a second, but scripts can only work so fast. So what I've done instead is increased the number of pixels jumped from 4 to 7. If you check again, you should notice that it is now much faster. I see you've noticed my personal anti-ripping method lol. By saving it as a gif file, it causes that error in FireFox and other like browsers, providing basic protection. I don't mind all that much if you want to tweak it up, so you have my permission as long as I'm still credited for my work. Simply view it in IE or Opera, or save it and open the gif file in notepad. |
![]() |
|
| atrimalous | Mar 14 2008, 01:45 PM Post #6 |
|
Legendary battousai
|
tweak? oh i might, but i mostly wanted to see how it was made/done. im not realy much of a ripper just for personal gain, i like to see how stuff works, so i can further my knowledge in js. although your anti rip method is excellent. i like it. quite effective. |
![]() |
|
| Mwr247 | Mar 14 2008, 01:47 PM Post #7 |
|
Cęsaris Salutis!
|
I understand Almost all my js has been learned through the work of others, especially in working on my modifications of Epsilekt's shoutbox. I've come along way since then.I must warn you though, I was pretty sloppy in my coding here lol. Never even got around to renaming my variables, so alot of them probably won't make sense. I probably could have streamlined it a bit, but I was so annoyed with the sliding not working, I decided I needed a break first. |
![]() |
|
| atrimalous | Mar 14 2008, 01:50 PM Post #8 |
|
Legendary battousai
|
hmm, haha, i jus realized how to see your work too. lol. it was so simple, yet no one would think of doing it. lol. nice. btw on the test forum, how much was it sped up by? 1, 2?. it almost seems to go the same rate. only when i click 2 of the cat's at the same time does it seem to go faster... edit: oh no, i understood your coding, perfectly. i could follow each varibal eto where it as and everything, the only thing i still havent quite figured out (caus ei suck) is the whole "cookie" thing. |
![]() |
|
| Mwr247 | Mar 14 2008, 02:04 PM Post #9 |
|
Cęsaris Salutis!
|
It was sped up by a little short of double. Did you refresh so it could load the new code? What about the cookies was hard to understand? The concept, or my use of them (I don't know how much you know at this point)? The hidecat() function works like a basic toggle switch with the cookies. When called upon, it checks for the cookie, and if present, deletes it. If not, it writes it. Cookies are kept separate by the category id's. Now if you look higher up in the code under the part where I messed with the tables, that's where it looks for the cookie. If there is a cookie, it presets the height to 0, and display to none, and when gone, it lets it display like normal. Hope that helps. |
![]() |
|
| atrimalous | Mar 14 2008, 02:28 PM Post #10 |
|
Legendary battousai
|
yeah, actually it does. and if i had to say what really gets me, it would be the concept of even using cookies. or how to make one. heh, infact the only think i know about cookies is, its stored in your browser, and it works kinda like, a "go back" button. or something. argh, blah, yeah, ok, i'll sum it up in a few words. "cookies confuse me". and no i didnt, refresh it, i just closed out of it, and then click on yoru link rom here again. edit: ahaha, after click on the link again, form yoru preview link here i clicked refresh and now it does seem faster. |
![]() |
|
| trinigangsta | Mar 14 2008, 02:34 PM Post #11 |
|
Unofficial Help Staff :P
|
dam that's pretty cool In your preview, your board is having a seizure or something |
![]() |
|
| ~kato~ | Mar 14 2008, 02:40 PM Post #12 |
|
A.K.A Mankato
|
I must have a coding conflict. The categories close but won't re-open.
|
![]() |
|
| Mwr247 | Mar 14 2008, 02:41 PM Post #13 |
|
Cęsaris Salutis!
|
atrimalous: It was probably cached in your browser, so refreshing loaded the new code. As for cookies, they are quite valuable, but also relatively easy to use. So I recommend looking up a tutorial on them. Basically, cookies are like little files saved with your browser, that allows the webpage to pull data out of them. In this use, it saves a little bit telling what site the cookie applies to, the title of the cookie (so it's not confused with other cookies on the site), the value or the cookie (0 to hide, 1 to show), and when the cookie expires (you can set cookies to delete themselves after a certain amount of time). The script reads those lines and makes it's decisions accordingly. Another example is using cookies to store password information, so the site knows that you are logged in. trinigangsta: The seizure problem should only happen if you click a button twice while it's opening lol. It doesn't know if it's supposed to go up or down. ~kato~: Interesting... what browser do you use? |
![]() |
|
| ~kato~ | Mar 14 2008, 02:48 PM Post #14 |
|
A.K.A Mankato
|
I use IE7 It does the same thing on both my sites. |
![]() |
|
| atrimalous | Mar 14 2008, 02:50 PM Post #15 |
|
Legendary battousai
|
ohh, well see, now cookies at least make sense to me a bit more. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Code Snippets · Next Topic » |
- Pages:
- 1
- 2






6:04 AM Nov 25