4 Replies Latest reply: Jan 17, 2012 7:59 PM by socahweir RSS

    anchoring inside an accordian

    socahweir Community Member

      I am trying to create an anchor that opens an accordian and goes to a specific part of a table. Here is a screenshot of a general idea of what this would look like. When you click on the "Question 1" hyperlink, the accordian will open and anchor to Question 1 in the table.

       

      For the anchor I have used just the general anchor html: <a name="Question1" id="Question1">Question 1</a>. For the hyperlink to the accordian anchor I tried to use (but it does not work): <a href="#" onClick="accordion.expandone('Question1', 0); return false">Question 1</a>

       

      Any help is much appreciated!

       

       

      Picture 8.png

        • 1. Re: anchoring inside an accordian
          Ben Pleysier CommunityMVP

          This depends on the accordion being used. If you use a SpryAccordionPanel then have a look here http://foundationphp.com/tutorials/spry_url_utils.php

           

          Gramps

          • 2. Re: anchoring inside an accordian
            socahweir Community Member

            Thank you! This is extremely helpful and almost completely answers my question. Following the link instructions above I was able to get the "Question 1" link to open the appropriate accordian. The one problem that still remains is that some of the tables within the accordian have up to 10 question rows. I need the link to open both the accordian and anchor directly to the appropriate question.

             

            The hyperlink reads:

            <a href="file.html?tab=&amp;panel=#TabbedPanels">Question 6?</a>

             

            The anchor to the specific table row is:

            <a name="Question6" id="Question6" rel="nofollow"> </a>

             

            My thought is that this just needs a simple change in the hyperlink. I've tried multiple combinations of adding name/id=Question6, but nothing has worked so far. (EG: <a href="file.html?name=Question6;tab=&amp;panel=#TabbedPanels">) Any thoughts?

             

             

             

             

             

            • 3. Re: anchoring inside an accordian
              Ben Pleysier CommunityMVP

              Have a look at the following. Copy and paste into a new document and view in your favourite browser.

               

              <!DOCTYPE HTML>
              <html>
              <head>
              <meta charset="utf-8">
              <title>Untitled Document</title>
              <link href="SpryAssets/SpryAccordion.css" rel="stylesheet">
              </head>
              
              <body>
              <div id="Accordion1" class="Accordion" tabindex="0">
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Label 1</div>
                  <div class="AccordionPanelContent">Content 1</div>
                </div>
                <div class="AccordionPanel">
                  <div class="AccordionPanelTab">Label 2</div>
                  <div class="AccordionPanelContent">
                      <p>Exploitation of core competencies as an essential enabler, measure the process, not the people. Motivating participants and capturing their expectations, the new golden rule gives enormous power to those individuals and units, defensive reasoning, the doom loop and doom zoom. Building a dynamic relationship between the main players.</p>
                    <p>Benchmarking against industry leaders, an essential process, should be a top priority at all times whenever single-loop learning strategies go wrong, in a collaborative, forward-thinking venture brought together through the merging of like minds. Empowerment of all personnel, not just key operatives, working through a top-down, bottom-up approach, motivating participants and capturing their expectations. The three cs - customers, competition and change - have created a new world for business taking full cognizance of organizational learning parameters and principles, by adopting project appraisal through incremental cash flow analysis. The components and priorities for the change program empowerment of all personnel, not just key operatives, the balanced scorecard, like the executive dashboard, is an essential tool.</p>
                    <p><a name="Question6"> QUESTION 6 - An important ingredient of business process reengineering working through a top-down, bottom-up approach, to focus on improvement, not cost. That will indubitably lay the firm foundations for any leading company the new golden rule gives enormous power to those individuals and units, in a collaborative, forward-thinking venture brought together through the merging of like minds. Defensive reasoning, the doom loop and doom zoom exploitation of core competencies as an essential enabler, building a dynamic relationship between the main players.</p>
                    <p>By moving executive focus from lag financial indicators to more actionable lead indicators, the vitality of conceptual synergies is of supreme importance combined with optimal use of human resources. The components and priorities for the change program highly motivated participants contributing to a valued-added outcome. The balanced scorecard, like the executive dashboard, is an essential tool that will indubitably lay the firm foundations for any leading company by adopting project appraisal through incremental cash flow analysis. Big is no longer impregnable to focus on improvement, not cost, the vitality of conceptual synergies is of supreme importance. Through the  adoption of a proactive stance, the astute manager can adopt a position at the vanguard.</p>
                    <p>Working through a top-down, bottom-up approach. From binary cause and effect to complex patterns, in order to build a shared view of what can be improved, through the  adoption of a proactive stance, the astute manager can adopt a position at the vanguard. To focus on improvement, not cost, an important ingredient of business process reengineering an investment program where cash flows exactly match shareholders' preferred time patterns of consumption. That will indubitably lay the firm foundations for any leading company big is no longer impregnable the new golden rule gives enormous power to those individuals and units. As knowledge is fragmented into specialities working through a top-down, bottom-up approach, building a dynamic relationship between the main players.</p>
                  </div>
                </div>
              </div>
              <script src="SpryAssets/SpryAccordion.js"></script>
              <script src="SpryAssets/SpryURLUtils.js"></script>
              <script> 
              var params = Spry.Utils.getLocationParamsAsObject();
              var Accordion1 = new Spry.Widget.Accordion("Accordion1", {defaultPanel: params.panel ? params.panel: 0});
              </script>
              </body>
              </html>
              

               

              Then in the browser address bar add ?panel=1#Question6 to the URL

               

              Gramps

              • 4. Re: anchoring inside an accordian
                socahweir Community Member

                That was it! Really appreciate your help. Thank you!