SitePoint Sponsor

User Tag List

Results 1 to 14 of 14
  1. #1
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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.
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    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
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  3. #3
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    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?

  4. #4
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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>
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  5. #5
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by unconformed View Post
    @ 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.
    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.

  6. #6
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Max Height View Post
    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
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  7. #7
    Non-Member Max Height's Avatar
    Join Date
    Dec 2011
    Posts
    303
    Mentioned
    6 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by unconformed View Post
    Yep total noob. I would love to go and do some research into the principals behind javascript/programming.
    That's a good starting point

    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.

  8. #8
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by unconformed View Post
    I am currently doing jquery tutorials at w3 schools.
    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 other tutorials in a few other places

    Quote Originally Posted by unconformed View Post
    Aussie John, is that your site? I love the way you can see all of the code at work here, brilliant!
    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

    Quote Originally Posted by unconformed View Post
    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.
    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.)
    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  9. #9
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Max Height View Post
    That's a good starting point

    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.
    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.
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  10. #10
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by AussieJohn View Post
    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 other tutorials in a few other places


    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


    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.)
    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.
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  11. #11
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    776
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by unconformed View Post
    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).
    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 http://yuiblog.com/crockford/


    var details = {
    . . web: "afterlight.com.au",
    . . photos: "jvdl.id.au",
    . . psa: "usethelatestversion.com"
    }

  12. #12
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  13. #13
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    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.
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!

  14. #14
    SitePoint Addict
    Join Date
    May 2006
    Posts
    288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FYI currently going through the sitepoint javascript pdf book and getting lessions from the guy who helped me with this problem.
    Get a little bit extra out of life with www.stakemyrep.com
    and stay motivated the easy way!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •