Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8291033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:59:33+00:00 2026-06-08T12:59:33+00:00

i am trying to open the the accordion using external link..Actually there are three

  • 0

i am trying to open the the accordion using external link..Actually there are three main accordions on the page(about,results,contact)

and there is a menubar with items(about,results,contact).

what i want is when i click on about menu item it should open the about accordion

the below is jquery code

$(function() {

    $( "#accordion" ).accordion({              
        collapsible: true,
        autoHeight: false , 
        active: false,
        navigation:true,       

    }); 

    $(".exlnk").click(function(event){
           window.location.hash=this.hash;
            });         
});

The below is html menubar code:

    <div id="navmenu" style='z-index:9999;'>
      <ul>
        <li><a href="#anchor_about" class="anchor_about">About</a></li>
        <li><a href="#" >Results</a></li>
       <li><a href="#" class ="anchor_contact">Contact</a></li>
      </ul>
    </div>

and below is jquery code for external link

    <script>

     $(document).ready(function(){

     $('a.anchor_about').click(function(){

     $("#accordion").accordion("activate", '<?php echo $_GET['id']; ?>');

 return false;

  });
   });

   </script>

but its not working..:(

anyone knows about same?
thanks in advance

EDIT1

<script>

 $("#navmenu ul").children("li").click(function()
 {
  $("#accordion").accordion("activate", <?php echo (int)$_GET['id']; ?>);
});

EDIT2

Below is the accordion code

        <div class="demo">                      

            <div id="accordion">                                                       <!--- main accordion 1 demo-->
                <h3><a href="#anchor_home"></a></h3>                            
                    <div id="accordion1" style="margin-bottom:17px;"  >
                        <h1><a href="#" ></a></h1>
                            <div id="content_our_offer" >                              <!--- sub accordion 1 demo-->
                                <?php $page_id=1742;?>                      
                                <?php get_page( $page_id ) ;
                                $page_data = get_page( $page_id );
                                echo '<h3>'. $page_data->post_title .'</h3>';// echo the title
                                echo apply_filters('the_content', $page_data->post_content); ?>              
                            </div>

                    <div style="margin-top:20px;">                                   <!--- sub accordion 2 demo-->
                        <h2  ><a href="#" ></a></h2>    </div>          
                            <div id="content_our_offer" >
                                <?php $page_id=1742;?>                      
                                <?php get_page( $page_id ) ;
                                $page_data = get_page( $page_id );
                                echo '<h3>'. $page_data->post_title .'</h3>';// echo the title
                                echo apply_filters('the_content', $page_data->post_content); ?>              
                            </div>

            </div>


            <div style="margin-top:20px;">
            <h6><a class="exlnk" href="#about" title="About" ></a></h6>   </div>                                              <!--- main accordion 2 demo-->     
                <div id="id_ourresults">
                    <?php
                        $directory = 'our_results'; 
                        try {    
                            // Styling for images

                            foreach ( new DirectoryIterator("../" . $directory) as $item ) {            
                                if ($item->isFile()) {
                                    echo "<div class=\"expand_image\">";
                                    $path = "/" . $directory . "/" . $item;
                                    echo "<img src=\"" . $path . "\" width=861 height=443  />";
                                    echo "</div>";
                                    }
                                }
                            }
                            catch(Exception $e) {
                            echo 'No images found for this player.<br />';
                            }


       ?>




                </div>          
                <div style="margin-top:20px;">


            <h4><a href="#anchor_contact"></a></h4> </div>                                          <!--- main accordion 3 demo-->
                <div id="id_contactus">      
                    <?php $page_id=1791 ;?>
                    <?php get_page( $page_id ) ;
                    $page_data = get_page( $page_id );
                    echo '<h3>'. $page_data->post_title .'</h3>';// echo the title
                    echo apply_filters('the_content', $page_data->post_content); ?>              
                </div>        

            </div>

    </div><!-- End demo -->
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:59:34+00:00Added an answer on June 8, 2026 at 12:59 pm
    $('a.anchor_about').click(function(){
    
       $("#accordion").accordion("activate", '<?php echo $_GET['id']; ?>');
    
       return false;
    
    });
    

    I don’t think $_GET[‘id’] in the accordion activate line is going to work as I guess you want something like this

    $('a.anchor_about').click(function(){
       var sectionId = $(this).attr("href");
       $("#accordion").accordion("activate", sectionId);
    
       return false;
    
    });
    

    check if this works – if there are any errors let me know.

    EDIT **

    Also, I think to open accordion you need an index based value not a ID value like #someId (which works for tab for sure). The index is zero-based so that first section of accordion can be activated by passing a zero value, second with 1, and so on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to open an accordion based on a link i send to
I'm trying to create a nested navigation accordion using the UI. (There's lots of
I am trying open a new window using url.Action. And the new Window url
I´m trying to open a tab using jquery, here is my code: $(#ecContenedorFolders).tabs({ tabTemplate:
I'm trying to open a zip file with jython using FileInputStream and ZipInputStream. But
The site I'm trying to spider is using the javascript: request.open(POST, url, true); To
I'm trying to create a custom accordion using jquery, have read through quite a
I'm trying to build a sort of Accordion effect using a GridView and UpdatePanels.
I'm trying to beat a basic accordion style menu into submission – using jQuery.
I'm trying to create an aggregation for my open graph action using the number

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.