Checkbox (only) controls open/close function of collapsible panel

I have a form with several collapsible panels in it, each
with a checkbox in the tab area, like so:
<div id="CollapsiblePanel1" class="CollapsiblePanel">
<div class="CollapsiblePanelTab" tabindex="0">
<input type="checkbox" name="checkbox_array[]"
value="i_need_this" />
I need this!
</div>
<div
class="CollapsiblePanelContent">Content</div>
</div>
My question is this: Is there any way to control the
open/close function of the collapsible panel using only the
checkbox located within the tab? Ideally, the panel would still
change based on hover, focus, etc.
In advance, let me just say thank you so much for any help
you might provide with this.
- Devin

Yessir, it is possible. I was struggling with something
similar myself, and got it figured out. You'll need to do this in
two steps.
First, you should disable the existing listener, so that when
you click the tab area nothing happens. You'll need to wade into
your SpryCollapsiblePanel.js file and comment out a line. Somewhere
around line 191 you'll find a function called
"Spry.Widget.CollapsiblePanel.prototype.attachPanelHandlers".
Within that function, around line 198, you'll find the following
code:
quote:
Spry.Widget.CollapsiblePanel.addEventListener(tab, "click",
function(e) { return self.onTabClick(); }, false);
Comment it out by typing a double forward slash (//) at the
beginning of the line like this:
quote:
// Spry.Widget.CollapsiblePanel.addEventListener(tab,
"click", function(e) { return self.onTabClick(); }, false);
If you test your code at this point, you'll discover that
you've broken the collapsible panel functionality. The panel won't
open. Now you need to set up your checkbox to trigger the
open/close functions. To do this, you just need to add an onclick
event to your checkbox like this:
quote:
<input type="checkbox" name="checkbox_array[]"
value="i_need_this"
onclick="CollapsiblePanel1.onTabClick();" />
The onTabClick() function simply checks if the panel is
already open, and calls either the open() or close() function as
appropriate. If you needed to, you could check whether the checkbox
is checked or not, then call the open() or close() functions
directly.
Please note that in modifying your SpryCollapsiblePanel.js
file like this, you'll be modifying the behavior of all collapsible
panels built using that file. If you need standard collapsible
panels as well, you'll need to add the same onclick event to your
tab panels manually.

Similar Messages

  • Script to Close all the collapsible panels on click of one collapsible panel

    Hi All,
    Please help me with modifying the script or a new script to suffice the following.
    I have around 5 to 6 collapsible panels in many html files. There is a huge content under each panel and thats the reason I want to collapse i.e., close all the open panels and open the panel that is clicked on.
    that is initially i click on panel 1 - > Panel 1 opens and contents are displayed.
    now I click on panel 2 - > panel 1 should close and panel 2 should open.
    Please help me acheive this.
    Thanks in advance.

    To close the remaining panels you can just use the onclick method and however many panels you have just add them to the list spacing them out with a " , "
    Here is an example of 3 panels that close and open, upon clicking on one of the panels.
    <div id="CollapsiblePanel1" class="CollapsiblePanel">
      <div class="CollapsiblePanelTab" tabindex="0" onclick="CollapsiblePanel2.close(),CollapsiblePanel3.close()">Tab 1</div>
      <div class="CollapsiblePanelContent">Long-Sleeve Prices</div></div>
    <div id="CollapsiblePanel2" class="CollapsiblePanel">
      <div class="CollapsiblePanelTab" tabindex="0" onclick="CollapsiblePanel1.close(),CollapsiblePanel3.close()">Tab 2</div>
      <div class="CollapsiblePanelContent">T-Shirt Prices</div>
    </div>
    <div id="CollapsiblePanel3" class="CollapsiblePanel">
      <div class="CollapsiblePanelTab" tabindex="0" onclick="CollapsiblePanel1.close(),CollapsiblePanel2.close()">Tab 3</div>
      <div class="CollapsiblePanelContent">Hat Prices</div>
    </div>

  • Adjusting isOpen function for Collapsible Panels

    I am interested in modifying the .js file or adding
    additional JS, to allow for when a page loads, to apply the proper
    tab class to the Collapsible tab. It seems with the curent .js as
    contructed, the page does not know to apply the proper class to an
    already opened panel tab, it only applies correctly when a user has
    actually clicked on the tab. How would I do it? All my classes are
    working correctly on the page in the Collapsible panels, I just
    need the proper class(focused or Open?) applied when the page loads
    versus waiting for user interaction.

    Hi JS3der,
    Nice catch. It's a one line fix. If you have the version of
    SpryCollapsiblePanel.js from Spry Pre-Release 1.5, all you need to
    do is find line 287:
    if (this.contentIsOpen || this.hasClassName(panel,
    this.openClass))
    this.removeClassName(panel, this.closedClass);
    and above the removeClassName call, add a call to
    addClassName like this:
    if (this.contentIsOpen || this.hasClassName(panel,
    this.openClass))
    this.addClassName(panel, this.openClass);
    this.removeClassName(panel, this.closedClass);
    --== Kin ==--

  • Why I can not use the pinch open & close function on Mac in this new firefox

    The track pad function pinch open and lose .

    Recently both the Yahoo! Toolbar extension and the Babylon extension have been reported to cause an issue like that. Disable or uninstall those add-ons.
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • Expand or collapse all collapsible panels at once.

    Hi,
    I have a page with a number of collapsible panels on it generated from SpryData.
    I know the collapsible panel names because their IDs are generated from the Spry data with
    <div class="CollapsiblePanel" id="cp{ds_RowNumber}" spry:repeat="Events">
    I have a couple of links on the page that I want our members to be able to click to be be able to collapse or expand all collapsible panels at once. How can I return a reference to the collapsible panel objects so I can close / open them using the open / close functions of the widget etc?
    See http://www.thehmc.co.uk/Events4.html and the links with the text (Show or hide all event details)
    i.e. I have a function and I know Spry.$$ is not what I want , but what do I need to return the object reference?
    function dhide()
    var panelCount = Events.getRowCount();
    for (var p = 0;p < panelCount;p++)
      panelID = '#cp' + p;
      var mypanel = Spry.$$(panelID);
      var a = panelID.close();
    Thanks
    Phiol

    Hi,
    Yes I found CollapsiblePanelGroup in the Spry 1.6.1 samples and am now using the OpenAllPanels function.
    Finding the collapsible panel group API in the documentation isn't the most intuitive and you may wish to review.
    Regards
    Phil

  • IOS obviously allows only 10 Apps to be Chosen in The "Open in" function. How can I control which Apps ( if more than 10 are installed) can be selected?

    iOS obviously allows only 10 Apps to be Chosen in The "Open in" function. How can I control which Apps ( if more than 10 are installed) can be selected?

    I think that is influenced by the order in which the apps are installed on the iPad (I believe that it's the most recent 10 ?) - but as I haven't got more than 10 apps that support any document/file type I can't check.
    If you want to able to edit the list, then you could try leaving feedback for Apple : http://www.apple.com/feedback/ipad.html

  • Collapsible Panels - Links to open one, and close others

    Hi,
    I am new to Dreamweaver and have been creating my site by
    learning as I go along. I have already read through all the other
    related topics associated with Collapsible Panels on this blog and
    have still not found an answer. I have been able to open and close
    Collapsible Panels by using links - but unfortunately, I need more
    than just opening and closing.
    On my site i have approximately 5 pages, all with the same
    header and Menu bar. The Information (that i have presented in
    numerous Collapsible Panels) does however vary from page to page.
    What I need to try and figure out is:
    How can I open one collapsible panel and close all others? I
    have seen the one example which leads to my next question:
    How can I group Panels? Some examples of how to open one and
    close all others use this grouping. Is there any other way of
    opening one and closing all others without grouping?
    Lastly, is it possible to set up a link that can be viewed on
    one page which when clicked opens the relevant page and collapsible
    panel? i.e. on my About Us page there is a link (using the Menu
    bar) for one of my several services on the services drop down menu
    (but services is on a different page with the same setup). When a
    viewer clicks on the specific service, is it possible to get the
    site to open the services page, and open the relevant collapsible
    panel (with all other Panels closed)?
    Any assistance would be greatly appreciated - I have been
    searching for days now and cannot seem to find any
    answers/directions in laymans terms.
    Kind regards,
    John

    wlsjoh013 wrote:
    > Hi,
    >
    > I am new to Dreamweaver and have been creating my site
    by learning as I go
    > along. I have already read through all the other related
    topics associated
    > with Collapsible Panels on this blog and have still not
    found an answer. I
    > have been able to open and close Collapsible Panels by
    using links - but
    > unfortunately, I need more than just opening and
    closing.
    >
    > On my site i have approximately 5 pages, all with the
    same header and Menu
    > bar. The Information (that i have presented in numerous
    Collapsible Panels)
    > does however vary from page to page. What I need to try
    and figure out is:
    >
    > How can I open one collapsible panel and close all
    others? I have seen the one
    > example which leads to my next question:
    This page has an example that has a link that can open and
    close a panel:
    http://labs.adobe.com/technologies/spry/samples/collapsiblepanel/collapsible_panel_sample. htm
    One way to do this would be to have a single link that would
    open one of your panels using the code, but then add to it code
    that closes each of the other panels, for example:
    <a href="#"
    onclick="CollapsiblePanel4.open();CollapsiblePanel5.close();CollapsiblePanel6.close();">O pen
    4, close 5 and 6</a>
    To make this work, you'll need to look that the panel
    constructors at the bottom of your page and make sure to match up
    the panel variable names i.e. "var CollapsiblePanel1 =...." the
    variable is CollapsiblePanel1.
    You could also write a function that gathers together the
    various panels you have on the page and then pass to it only the
    panel that you want kept open. For now, though, it might be best to
    use the above method, given your expertise. And taking that even
    further, you could apply the function call unobtrusively. Both the
    function call and the unobtrusive part you can work on later to get
    this working for now.
    > How can I group Panels? Some examples of how to open one
    and close all others
    > use this grouping. Is there any other way of opening one
    and closing all
    > others without grouping?
    This is a little confusing, on one hand you ask about how to
    group, but then ask how not to group. There is a concept of a
    collapsible panel group:
    http://labs.adobe.com/technologies/spry/samples/collapsiblepanel/CollapsiblePanelGroupSamp le.html
    But there is another type of group, that may be more what
    you're looking for, and that's an Accordion panel, which is similar
    to the collapsible panel group, with the exception that it can only
    have one panel open at a time.
    > Lastly, is it possible to set up a link that can be
    viewed on one page which
    > when clicked opens the relevant page and collapsible
    panel? i.e. on my About Us
    > page there is a link (using the Menu bar) for one of my
    several services on the
    > services drop down menu (but services is on a different
    page with the same
    > setup). When a viewer clicks on the specific service, is
    it possible to get
    > the site to open the services page, and open the
    relevant collapsible panel
    > (with all other Panels closed)?
    Probably the easiest way to do this particular one would be
    to make sure that you have all of the panels set to be closed when
    the page loads, and then take a look at the code for the last
    example on this page:
    http://labs.adobe.com/technologies/spry/samples/utils/URLUtilsSample.html
    That example uses a tabbed panel, but the concept is the
    same, use a URL parameter to determine what to show. You'll need to
    link in the SpryURLUtils file in the Spry download package (look in
    the includes folder):
    http://labs.adobe.com/technologies/spry/home.html
    Essentially, your link will look similar to:
    sample.html?panel=1
    Then your code could look something like:
    var params = Spry.Utils.getLocationParamsAsObject();
    var CollapsiblePanel1 = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel1",
    {contentIsOpen:(params.panel==1 )} );
    var CollapsiblePanel2 = new
    Spry.Widget.CollapsiblePanel("CollapsiblePanel2",
    {contentIsOpen:(params.panel==2 )} );
    Basically what this is doing is creating an object from the
    URL parameters. Then for each of the panels the constructor has
    code that determines whether or not to expand the panel when the
    page loads. So it checks the value of params.panel to see if it
    matches 1 (for the first one), if it does, then that means that
    contentIsOpen is set to true, if it is some other number or is not
    present at all, then that means that the panel is closed. This
    would then be repeated down the line for how ever many panels you
    want to operate like that.
    Danilo Celic
    |
    http://blog.extensioneering.com/
    | WebAssist Extensioneer
    | Adobe Community Expert

  • Word 2010 - Extra Space Around Checkbox Content Controls - only on some computers

    I am experiencing a problem with Word 2010 adding extra above/below spacing on content control checkboxes, but only on some of our computers. We have a template we use that is the same file for our network. On some of the computers in our office however,
    we get extra spacing what can not be removed.  
    I am at a lose to fix this and have been trying for about 3 weeks. The settings are the same on all the computers. The user can switch to another computer and the form will open correctly, but if they move back to their workstation and try to reopen it there
    the double spacing returns - again only for the checkbox content controls. 
    Attached are two images - Correct formatting, and then what happens on some of the computers. Any assistance would be greatly appreciated. 
    Can't post links due to account not verified
    Correct Formating Image - https://drive.google.com/file/d/0BzORWKV0f6tjWjdaTGxTd0tWeUk/view?usp=sharing
    Extra Space Added on Some Comptuers Image - https://drive.google.com/file/d/0BzORWKV0f6tjOU8wYXp0d1ZZVDA/view?usp=sharing

    Some issues worth noting:
    1. Word uses information returned by the active printer driver to manage a document's layout. This can result in line spacing, text-wrapping, and so on varying from one PC to the next - or even on the same PC when switching to a printer that uses a different
    driver.
    2. Differences in font versions (or the use of a font that is available on one PC and not another) can result in line spacing, text-wrapping, and so on varying from one PC to the next.
    3. Differences in Word version (or even update state) may result in line spacing, text-wrapping, and so on varying from one PC to the next.
    4. Your document that displays the extra spacing has Word's formatting display switched on - even that can change the appearance if the document contains hidden content.
    5. Various Word options can also affect line spacing, text-wrapping, and so on. These include having Word configured to 'optimize character positioning for layout rather than readability', 'scale content for A4 or 8.5x11" paper sizes' and, perhaps,
    the use of draft print quality.
    Obviously, there are multiple possibilities to work through, ensuring all PCs & printer configurations are the same. That said, your use of tables allows you the option of setting the row heights to 'exact' measurements, so they won't expand as they
    evidently now can. You can also try setting the paragraph line spacings and before/after spacings to precise numbers of points, for example, so they don't auto-adjust.
    Cheers
    Paul Edstein
    [MS MVP - Word]

  • Trackpad Zoom Controls - pinch open & close application specific disable

    Does anyone know if there is a way of controlling trackpad zoom controls so that "pinch open & close" can be disabled for specific applications (including the finder)?
    I have solved the majority of my concerns with Browsing and Office by using Firefox and NeoOffice - both of which have a fix included.
    It would be nice to have the same control over the finder so that the icons are not being re-sized inadvertently.

    Well - I'm betting this is a software problem ... but it is certainly the case that only those armed with MBP's having the new multi-touch trackpad would see it and be able to check it out on their own computers.
    The fact that the pinching mechanism works (as do all of the other multi-finger features) attests to the fact that the improved track pad is in fact discriminating the different kinds of actions correctly.
    The catch is that I can disable the other multi-finger features .... but unchecking the pinch feature does not disable it .... in my experience, this would make the operating system a more likely culprit for the problem ... my assumption here is that it is the OS that is making the decision whether or not to ignore certain kinds of input from the trackpad when certain features are disabled.
    Thanks for moving the post ... hopefully it'll get answered in this new forum.

  • Pinch open and close function not working after upgrade

    I'm having trouble with the pinch open and close function on my trackpad. It was working fine until I installed the new Google upgrade and now it doesn't seem to be working. Any suggestions. The other functions are working fine.

    Click on the Apple icon at the top left of the screen. Select "System Preferences", then "Trackpad".
    Be sure to select:
    "Pinch Open and Close" in the "Two Finger" Menu...
    Sly

  • My Ipad wont retrieve my new emails and if I try to check passwords in Settings, the settings window only stays open open for a second or two and the automatically closes. Any help on how to fix. I tried the turn off and on trick and that didn'

    My Ipad wont retrieve my new emails and if I try to check passwords in Settings, the settings window only stays open open for a second or two and the automatically closes. Any help on how to fix. I tried the turn off and on trick and that didn't work either. Thanks for any help.

    Try reset iPad
    Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
    Note: Data will not be affected.

  • Collapsible Panel Group - automatic close/open?

    Is there a way to set it so the Spry Collapsible Panel Group automatically closes an open panel when you select to open another one?
    Thank you.

    Uhm... I think you should swap the collapsible panel group for a Spry Accordion: http://labs.adobe.com/technologies/spry/samples/accordion/AccordionSample.html

  • ESYU: "Open/Close Periods" 와 "Control Purchasing Periods"의 차이점

    Purpose
    Oracle Purchasing - Version: 11.5.10
    FORM:POXSTCPP.FMB - Control Purchasing Periods GUI
    FORM:GLPRDED.FMB - Open/Close Periods
    "Open/Close Periods" 와 "Control Purchasing Periods"의 차이점이 무엇인지
    알아본다.
    Solution
    1. Purchasing Periods 관리
    (Purchasing-->Setup -->Financials --> Accounting-->Control Purchasing Periods)
    Control Purchasing Periods는 Purchasing Period를 관리한다.
    Purchasing periods는 Receiving Sub Ledger에 ledger 입력을 관리한다.
    Purchase Orders와 Receipts(만일 PO를 Inventory로 넘겨줘야 한다면 transaction date는
    Inventory Accounting Period 안에 있어야 한다) process를 위해서는 Purchasing period는
    Open 되어져야 한다.
    만일 예산 관리/Encumbrance Accounting을 사용한다면, Purchasing은 PO distribution과
    Requisition distributions에 입력된 GL date가 open Purchasing period 안에 있는 날짜인지를
    검토한다.
    만일 집중화된 Procurement를 사용한다면, Purchase Orders와 Receipt process를 원하는
    모든 Business units 안의 Purchasing Period는 Open 상태로 남아 있는지 확인해야 한다.
    2. Open/Close Period
    (Purchasing-->Setup-->Financials --> Accounting-->Open/Close Period).
    이 화면은 GL periods를 관리한다.
    GL periods는 GL에서 posting과 journal 입력을 관리한다.
    Reference
    Note 394361.1

    Hi Vamsi,
    Thanks for your response and our company metalink account has been expired, and Oracle no longer support us.
    I want to confirm that, do you mean that I update the adjustment month on gl_period_status, then the system can generate the 'missing' inventory accounting period and purchasing period, and also other periods that should be existed?
    Thanks for kindly help!
    Joseph

  • I have opened a page in WORD and cut and tried to paste a photograph to it. The result is that the page is now frozen with the coloured circle{ cursor} spinning around and not letting me do anything with the page. I only wish to close it down. Thank you

    Have opened a page in WORD and tried to cut and paste to it.  The result is that the page is frozen with the  coloured cursor just spinning around and not letting me do anything with the page. I only wish to close the page down. Thanking you

    Many thanks for your help in this instance. The command-option-shift-esc and force quit solved the problem for me . Now I can get back to using my computer once more

  • Spry Collapsible Panels - Way to set them open only once per visit?

    I'm wondering if there is a way to set a Spry Collapsible
    Panel to be automatically open on the initial loading of the site,
    but as people navigate around the site and back and forth from the
    home page, to be able to have it closed on subsequent visits to the
    home page.
    Right now I have a collapsible panel set to OPEN by default
    when someone first hits the home page, but if they navigate around
    the site and then click to the home page again, they get the panel
    open again. Naturally, that will end up annoying people.
    Any suggestions?
    Thanks in advance!
    Sara

    Flash local shared object can help with this. Here is some info:
    http://www.bestflashanimationsite.com/tutorials/4/
    http://www.permadi.com/tutorial/flashSharedObject/index.html
    http://www.kirupa.com/developer/mx/sharedobjects.htm
    Best wishes,
    Adninjastrator

Maybe you are looking for

  • How can we get Dynamic columns and data with RTF Templates in BI Publisher

    How can we get Dynamic columns and data with RTf Templates. My requirement is : create table xxinv_item_pei_taginfo(item_id number, Organization_id number, item varchar2(4000), record_type varchar2(4000), record_value CLOB, State varchar2(4000)); ins

  • External Disk Access Suddenly Slow

    It now takes forever to load files (Open a finder window) when I open an external drive partition that contains my imovie files and main backup partition on the same external drive. I never had a problem before. The permissions for the "Backup" parti

  • Imaging.s - while loop - preboot bundle

    I've noticed that either 11.2 or 11.2.1 has added a while loop to imaging.s the comments indicate it is to allow multiple activities to take place. i have a preboot bundle that runs img to lay down some zmg files. nice and simple. in this new scenari

  • Have a gray screen with a flashing folder and no original CDs what can I do.

    Can't boot up my mac at all. I have tried using command R and that did nothing for me I also tried using the command option P R and that did nothing I do not have the original CDs anymore And my latest backup is from awhile ago Anyone with an idea I

  • Changing weblogic-application.xml

    I deploy an EAR file which contains <prefer-application-packages> at weblogic-application.xml. Then, I deploy other applications. According to CAT, I need to modify weblogic.xml. Can I add new contents to that file without redeployment?