Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] Multiple checkboxes and JS

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #192981
    Romchick
    Participant

    Hey there… Please put me on the right way:
    Here is the code: http://codepen.io/NeedHate/pen/XJpLBK
    Appologies, its in Russian, so I made “Click here” lable and link. When I click the link it goes to checkbox and oppens it. All around this accordion many links which lead to an other links with checkboxs. Now the link works AS IT HAS TO BE only on $(“#check-box-7”).prop(‘checked’, true);. So the question is “how to make all links in accordion open its checkboxs”.

    #193006
    shaneisme
    Participant

    I’m not 100% sure what the intended behavior is based on your example and I’m pretty sure it’s just a language barrier thing so we’ll figure it out (unless someone else sees something I’m not).

    When you click on the first “CLICK HERE” it opens up one of the modules*, and the second “CLICK HERE” opens up #create-project. That’s what I’m seeing anyway on my end.

    Now, is your question how do you make all modules* open up at the same time, or did I miss what you needed entirely?

    * Technically, if we’re arguing semantics (which I love to do), an accordion will only have one thing open at a time.

    #193012
    Romchick
    Participant

    Hi, Shaneisme. The goal is to make every link (for example, <aa href='#create-project'> or <aa href='#create-something'>) be able to open accordion element as I click on one from another accordion element.
    In text there are many links to accord elements: “…if you want this go and check it -here-. And this -here- links to another accordion element.
    Accordion elements = modules.

    #193043
    Romchick
    Participant

    Guys, here is the best Paint picture I’ve ever made: http://eyes.in.ua/wp-content/uploads/2014/07/Accordion.png
    It is to show what is needed.

    #193054
    Romchick
    Participant
    #193091
    shaneisme
    Participant

    OK – I see what you want.

    First, I’d totally rework the markup you’re using on the accordion.

    This is one way to do it:

    http://codepen.io/drainpip/pen/viDuq

    #193114
    Romchick
    Participant

    shaneisme, thank you. It’s bad that I will have to remove current code. By the way, I was not able to find the answer on my question around internet. Like I’m the only one with this issue.
    Thanks for the help again, surely I will use your example.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.