Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Help Me Improve The Help Files

Author
Message
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Jan 2013 05:07 Edited at: 18th Jan 2013 05:12
Well, help me learn HTML, Javascript and CSS!
I took on the challenge of fixing and improving the old DBC help files as it would give me something to work on while learning the above languagey-markup-blah whatever you call them.

I have attached some files I would like some advice on.

I've written a script to show/hide command information when you click on the name and if you link to a bookmark on the page (each command has its own bookmark) then it will expand that command when the page loads (pretty nifty heh?). I would like to make it so that when a second command name is clicked on, the previous one collapses again. Any ideas how I could do that?

Are there any foreseeable problems in putting all the command information for an entire section in one html file? Is there a better way of getting the same effect? I feel like it would be better if I could have one template to read the info for each command into, but I don't know how to do that or if it would actually make any improvement. I can only use client-side scripting for this.

I thought I'd ask now before I've done lots of commands.

Cheers,

[edit]
Oh another thing was how to make the command info expand smoothly instead of instantly? I have a gradual colour fade for hovering over links which is quite nice, maybe it is similar to that?

Shh... you're pretty.
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 18th Jan 2013 09:25
You can start by using Max Widths and aim for a responsive design...

I love it so far...

Perhaps look into jQuery

It is easier to use a ready to go toolset sometimes

Quote: "I would like to make it so that when a second command name is clicked on, the previous one collapses again. Any ideas how I could do that?"


Content Slider > jQuery

Hope this helps, a bit of a large project for me to jump on board, but perhaps I can point you in the right direction sometimes if this was for DBP, I may have been more inclined ^^

This should help out a bit, I do not use it much but it is a free resource... includes jQuery!

Oh in case the question arises, jQuery is the baby of JavaScript

Hope this helped...

Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 18th Jan 2013 17:38
Thanks V, I'll have a look at those.

Shh... you're pretty.
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th Jan 2013 22:18
@ OBese87

This site is great for examples : http://dthmlgoodies.com/

In particular, this will answer your question : http://www.dhtmlgoodies.com/index.html?whichScript=show_hide_content_slide

TheComet

http://blankflankstudios.tumblr.com/
Quote: ""
- Randomness 128
Phaelax
DBPro Master
23
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Jan 2013 18:33
JQuery can do it, if you don't mind the overhead.

http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm

"You're not going crazy. You're going sane in a crazy world!" ~Tick
Libervurto
20
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 20th Jan 2013 22:35 Edited at: 21st Jan 2013 19:06
Thanks guys, I've tried messing around with both examples but it's too advanced for me at the moment so I'll have to go back to the basic javascript tutorials before I understand what I'm doing. Man being a noob sucks!

There's a crap ton of tutorials and things on the internet but I find a lot of the stuff people post includes a lot of needlessly complicated stuff. W3schools is good in that respect, they keep it simple.

[edit: update]

I managed to get the previous box to close when a new one is clicked.
I knew it was simple, I just didn't know how to declare a global:

All the examples I found where running for-loops and checking every element instead of just storing the last one that was clicked!
The e=e.nextSibling part is really bad but I can't figure out how to grab the command_content div that is within the clicked command div. (The parameter 'a' is the id of the command clicked.)

Shh... you're pretty.

Login to post a reply

Server time is: 2026-07-11 13:11:09
Your offset time is: 2026-07-11 13:11:09