Help to further collapse Months

Hi guys

I am trying to collapse a menu similiar to this site:

http://pulse.centrelink.gov.au/archive/

Currently, any dates within a month collapse. This is done using jquery and a wordpress plugin.

I would like to be able to FURTHER collapse the months so they also do not display.

So all the months under articles by date collapse, and all of the dates collapse.

Is there an easy way to do this?

I think this site uses the following plugin

“Clean archives Reloaded”

I am no javascript guru, but can this be done with some javascript on the page its self?

Thanks for any advice.

It would be fairly trivial to create an “expanding / collapsing” scenario with some basic markup and JS.

See this fiddle: http://jsfiddle.net/GeekyJohn/H34WJ/ for an example

Isn’t this exactly the same question as in your other thread?

If I post here, how do I know I’m not wasting my time since you might already have a solution in your other thread?

Hi Max

Yes, I have another thread, guilty as charged! I had it in the WP thread and created a new one here. Sorry for confusion I should have asked that the other be closed myself. It is closed now and I will respond here.

I am currently doing jquery tutorials at w3 schools.

@Aussie John thank you, i will take a look shortly at your link.

@ Max Just quickly though, given that the plugin uses jquery (I think I recall you don’t like it!), is jquery the best thing for me to focus on learning about? I am looking for the quick win.

I should probably copy some expanding/collapsing code and place it directly into the page I want to affect. So perhaps some straight up javascript can be placed over the documents structure (I am using Wordpress also) and plugin. Not really sure if that would work though.

Edit - Aussie John, is that your site? I love the way you can see all of the code at work here, brilliant! I still think I need to get my head around some basic concepts before I can implement.

Just to clarify a few things here:

The plugin can collapse the dates within a month. I want to be able to further collapse the Months so they don’t all display. Can I use Javascript on top of this plugin to further collapse the months? Or will I need to modify the jquery in the plugin.

THANKS GUYS!

<snip>

It’s not that I don’t like it (jquery has its place and purpose), but too many noobies come into forums like this looking for help with jquery while under an incorrect impression that jquery is some sort of shortcut to learning javascript or worse still, thinking that jquery is some sort of different language or technology to javascript. JQUERY IS JAVASCRIPT and in an “ideal world” people should first have at least a good understanding of the basics and principles of javascript and programming in general before playing with jquery. There is absolutely nothing you can do with jquery that you cannot do with plain javascript and quite often you will use less code with plain javascript to perform a given task.

Now that I’ve had my little rant, I’ll try to give you my opinion on how to tackle this. I recall you said somewhere you are not a javascript guru (in forum speak, to me that means you are a noobie;)). Given that is the case, since you are after a “quick win”, your best bet is to find someone with the skills to do what you need and be really nice to them in the hope they will give you the code or alternatively take the time to talk you thru writing/editing your own step by step. Unless you know what you are doing, you’re most likely to just dig yourself into a huge hole if you try messing with the plug-in code on your own, effectively blindfolded.

Yep total noob. I would love to go and do some research into the principals behind javascript/programming. It would help with my Wordpress stuff too. I’m tackling ‘the loop’ in Wordpress right now and not knowing basic programming markup is making it harder for me to understand.

I am really happy to go off and learn the right stuff to tackle this, and I don;t really know many javascript gurus so I guess that’s why I cam here. Lots of nice people here in my experince:)

That’s a good starting point :slight_smile:

Then in that case I would suggest you ditch jquery alltogether for now and have a go at coding up some basic html for the content you want to show/hide and then work through some plain javascript tutorials (w3schools is a popular place to start). Then have a go at coding up the plain javascript to show/hide the content wihen something is clicked.

If you get stuck, post back with your code. In my experience people are generally more willing to help someone if that someone posts some code showing they are making a genuine attempt at solving the problem.

Eeek. Stop. W3schools is probably one of the worst places to do any JavaScript related tutorials. Last I checked their “jQuery Quiz” for example still has errors in it. Please see www.w3fools.com for more info.

There are many [URL=“http://www.noupe.com/tutorial/51-best-of-jquery-tutorials-and-examples.html”]other [URL=“http://www.impressivewebs.com/jquery-tutorial-for-beginners/”]tutorials in a [URL=“http://jquery14.com/”]few [URL=“http://net.tutsplus.com/articles/web-roundups/jquery-for-absolute-beginners-video-series/”]other places :slight_smile:

Hah, no I wish. JS Fiddle is a site where you can place some code and run it / share it / collaborate on it for situations just like this :slight_smile:

Yeah, a couple of lines of jQuery or vanilla JavaScript will do the trick, you won’t have to modify the plugin. (Modifying plugins / 3rd party code in general is a bad idea because you will likely lose your changes when it gets updated, it is almost always better to layer your own code on top.)

Hi Max

Will do thanks. I’ll mark up some content I want to hide/collapse, and then do some tutorials.

I’ll post code as suggested when I get stuck.

Interesting link.

When I first started I found w3c schools to be hard to follow. I did learn a bit about jquery from their tutorials though.

Since i have started though on jquery, i am not sure which way to go. Max says javascript, but I am worried it will be harder to learn than jquery. It sounds like a simple enough task though (once I get my head around some basics).

Either way I will post some code. I might go off and do some javascript tutorials and see how I go.

JavaScript is most definitely the way to go. jQuery is JavaScript after all.

By learning JavaScript first, you will give yourself a good foundation in the language and in programming in general.

There are many good books and video tuts around for learning JavaScript.

I definitely recommend watching Douglas Crockford’s videos on the subject at [URL=“http://yuiblog.com/crockford/”]http://yuiblog.com/crockford/

Well i have it working.

A guy at my work made a social call on IM and I said, well I have this probelm. He made it work for me:)

I still have a small issue with it but it should be easy fix. I am going to hit the javascript tutes this weekend and make it work.

I have been doing tutorials. I am learning about object oriented programming, functions and events. I have something to fix with my script still I’ll have a look and post any code.

Thanks guys

I did not realise I have two threads in the javascript area, Ralph you were too efficient, you moved it for me.

FYI currently going through the sitepoint javascript pdf book and getting lessions from the guy who helped me with this problem.