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 8134703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:07:46+00:00 2026-06-06T10:07:46+00:00

where I am using Jquery UI. I have an accordion menu, which has multiple

  • 0

where I am using Jquery UI. I have an accordion menu, which has multiple hyperlinks in each accordion menu.

What I am trying to do, is when I click on one of these hyperlinks, I want it to open the page I am calling, that is to be displayed within a new tab that can be closed with an x (like these simple manipulation ones), but in a new tab to be displayed.

My aim is that I can have mupliple tabs open that have been launched by selecting differet hyperlink options within the accordion, so the user closes them when they want to.

I have not found anything on how to do this.

Can someone please help.

Thanks

  • 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-06T10:07:49+00:00Added an answer on June 6, 2026 at 10:07 am

    Hi I think I have worked it out. Thanks for responding @johnrobinson

    I did this with a button, but will do what I need.

            <!DOCTYPE html>
            <html>
                <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
                    <title>jQuery UI Example Page</title>
                    <link type="text/css" href="css/custom-theme/jquery-ui-1.8.20.custom.css" rel="stylesheet" />
                    <script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
                    <script type="text/javascript" src="js/jquery-ui-1.8.20.custom.min.js"></script>
                    <script type="text/javascript" src="js/jquery.callapse.js"></script>
                <meta charset="utf-8">
                <style>
                #dialog label, #dialog input { display:block; }
                #dialog label { margin-top: 0.5em; }
                #dialog input, #dialog textarea { width: 95%; }
                #tabs { margin-top: 1em; }
                #tabs li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 0; cursor: pointer; }
                #add_tab { cursor: pointer; }
                </style>
                <script>
                $(function() {
                    var $tab_title_input = $( "#tab_title"),
                        $tab_content_input = $( "#tab_content" );
                    var tab_counter = 2;
    
                    // tabs init with a custom tab template and an "add" callback filling in the content
                    var $tabs = $( "#tabs").tabs({
                        tabTemplate: "<li><a href='#{href}'>#{label}</a> <span class='ui-icon ui-icon-close'>Remove Tab</span></li>",
                        add: function( event, ui ) {
                            var tab_content = "andyContent" || "Tab " + tab_counter + " content.";
                            $( ui.panel ).append( "<p>" + tab_content + "</p>" );
                        }
                    });
    
                    // modal dialog init: custom buttons and a "close" callback reseting the form inside
                    var $dialog = $( "#dialog" ).dialog({
                        autoOpen: false,
                        modal: true,
                        buttons: {
                            Add: function() {
                                addTab();
                                $( this ).dialog( "close" );
                            },
                            Cancel: function() {
                                $( this ).dialog( "close" );
                            }
                        },
                        open: function() {
                            $tab_title_input.focus();
                        },
                        close: function() {
                            $form[ 0 ].reset();
                        }
                    });
    
                    // actual addTab function: adds new tab using the title input from the form above
                    function addTab() {
                        var tab_title = "andytitle" || "Tab " + tab_counter;
                        $tabs.tabs( "add", "#tabs-" + tab_counter, tab_title );
                        tab_counter++;
                    }
    
                    // addTab button: just opens the dialog
                    $( "#add_tab" )
                        .button()
                        .click(function() {
                        addTab();
    
                        });
    
                    // close icon: removing the tab on click
                    // note: closable tabs gonna be an option in the future - see http://dev.jqueryui.com/ticket/3924
                    $( "#tabs span.ui-icon-close" ).live( "click", function() {
                        var index = $( "li", $tabs ).index( $( this ).parent() );
                        if(index != 0){
                                    $tabs.tabs( "remove", index );
                        }
    
                    });
                });
                </script>
            </head>
            <body>
                <div class="demo">
                    <button id="add_tab">Add Tab</button>
                        <div id="tabs">
                            <ul>
                                <li><a href="#tabs-1">Nunc tincidunt</a> </li>
                            </ul>
                        <div id="tabs-1">
                            <p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
                        </div>
                </div>
            </body>
            </html>
    
            </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple accordion menu using jQuery. When I click a link inside
I have some tabs using jQuery UI which work just fine, but I want
I'm trying to create a custom accordion using jquery, have read through quite a
I have created an accordion using jQuery which collapses fine when the user clicks
I have collapsible sections created using jQuery UI Accordion. When each section is expanded
I am using jquery for accordion menu, I have got a news box on
I'm using jQuery UI accordion() . I have 4 tabs. I want to make
I have a single drop down using the accordion jQuery plugin but I want
I am using jQuery to produce an accordion effect in a menu I have
I have a simple accordion menu working using jQuery but I'm having trouble styling

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.