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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T21:35:44+00:00 2026-05-12T21:35:44+00:00

I added delete and edit link to the accordion header, yet those links are

  • 0

I added delete and edit link to the accordion header, yet those links are not working since every time i click on them the accordion open. And advice on how can I do it? Note that I’m doing nested accordion.
this is how i defined it on js:

$("#acc2").accordion({  alwaysOpen: false,active: false,autoheight: false,
            header: 'h3.ui-accordion2-header',clearStyle: true,
             event: 'click' });

and on html I have it like this:

<div class="ui-accordion2-group">
  <h3 class="ui-accordion2-header">
  <table border=0 width=100% class= 'DarkGray12'  >
    <tr>
      <td>
      <a href="javascript:toggel_new_activity('1');">Section Title</a>
      </td>
      <td align='right'>
        <table border=0>
          <tr>
            <td>
              <a href="javascript:toggel_new_activity('1');">New Activity</a>
            </td>
            <td>
              <a href='#'>Edit</a>
            </td>
            <td>
              <a href='#'>Delete</a>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
  </h3>
</div>
  • 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-05-12T21:35:44+00:00Added an answer on May 12, 2026 at 9:35 pm

    First thing, get rid of those tables in the h3’s. Use divs with css:

    <style>
    .ui-accordion2-header .tools{
        position: absolute;
        right: 10px;
        top: 10px;
        width: 345px;
    }
    .ui-accordion2-header .tools a {
        width: auto;
        display: inline;
    }
    </style>
    <div id="accordion" class="ui-accordion2-group">
        <h3 class="ui-accordion2-header" data-sectionid="1">
            <a href="#">Section Title</a>
            <div class="tools">
                <a href="#" class="newactivity">New Activity</a>
                <a href="#" class="edit">Edit</a>
                <a href="#" class="delete">Delete</a>
            </div>
        </h3>
        <div>
            <p>Mauris mauris ante, blandit et, ultrices a, suscipit eget, quam.</p>
        </div>    
    </div>
    

    Second, No need to add events inline do it up at the top:

    <script type="text/javascript">
    $(function() {
    $("#accordion").accordion({
        alwaysOpen: false,
        active: false,
        autoheight: false,
        clearStyle: true
    }).find('.tools a').click(function(ev){
        ev.preventDefault();
        ev.stopPropagation();
        var $obj = $(this);
        var sectionid = $obj.closest('h3').attr('data-sectionid');
        if ($obj.hasClass('newactivity')){
            toggel_new_activity(sectionid);
        } else if ($obj.hasClass('edit')){
            edit(sectionid);
        } else if ($obj.hasClass('delete')){
            delete(sectionid);
        }
    });
    });
    </script>
    

    ev.preventDefault() prevents the normal things that happen when you click an “a” tag from happening.
    ev.stopPropaggation() prevents the click event from getting to the according and toggling the status of the section

    The rest just figures out the id for the current section and makes the correct function call based on what link was clicked.

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

Sidebar

Related Questions

%p %br %span.footer_links = link_to 'Edit', edit_link_path(@link) = link_to 'Edit', edit_link_path(@link) = button_to 'Delete',
I added an image to button UIImage* deleteImage = [UIImage imageNamed:@Delete.png]; CGRect imageFrame=CGRectMake(-4,-4, 310,
How I can delete an object which I had added before with this code.
I try to delete a record in Gridview and Database .I added a boundfield
I have this code $(.delete2).click(function() { $('#load2').fadeIn(); } I have dynamically added item via
Everytime users did something like add, delete or edit data. I want to keep
I have a page where i add,edit and delete menus.For add and edit I
I'm serving up a page using ASP.Net. I have Add/Edit/Delete functionality of controls I've
I've got the following link in my page, <a href=#dialog name=delete data-id=75351 id=delete-75351 >Delete</a>
What kind of magic has this 'MSIMG32.DLL'? Why can't inno setup delete it? Edit:

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.