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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T23:19:37+00:00 2026-05-17T23:19:37+00:00

$(#trigger-1).click(function () { $(#secondary).animate({ width: 0 }); $(#primary).animate({ width: ‘100%’ }); $(#panel-1).css({ display: block

  • 0
$("#trigger-1").click(function () {
    $("#secondary").animate({ width: 0 });
    $("#primary").animate({ width: '100%' });
    $("#panel-1").css({ display: "block" }).animate({
        height: 200,
        width: '100%',
        opacity: 1
    });
    return false;
});
$("#trigger-2").click(function () {
    $("#secondary").animate({ width: 0 });
    $("#primary").animate({ width: '100%' });
    $("#panel-2").css({ display: "block" }).animate({
        height: 200,
        width: '100%',
        opacity: 1
    });
    return false;
});
$("#return").click(function () {
    alert(1);
    $("#primary").animate({ width: '60%' });
    $("#secondary").animate({ width: '40%' });
    $(".panel").animate({
        height: 0,
        width: 0,
        opacity: 0
    });
    return false;
});

Return is not working for panel-2. Please check this fiddle: http://jsfiddle.net/HTVXv/
Also, please guide me if its possible to refactor and reduce the code.

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-05-17T23:19:38+00:00Added an answer on May 17, 2026 at 11:19 pm

    No wonder, id’s should be unique, so you cannot use them twice.

    A solution is to use a class, like class="return" and $(".return").click()

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

Sidebar

Related Questions

.trigger { display : block ; width : 100% ; height : 100% ;
$(.trigger).click(function () { $(this).next(.toggle).slideToggle(fast); $(this).toggleClass(active); return false }); HTML: <input type=checkbox class=trigger> <div class=toggle>content</div>
In My jquery function i used to trigger click function from li and img
I wonder why this isn't working as expected: $(function() { $(.door1-trigger).click(function() { $(.door).hide(); //
<head> <script type=text/javascript> $(document).ready(function(){ $(.open_list).hide(); $(.trigger).click(function(){ $(this).toggleClass(active).next().slideToggle(800); }); }); </script> I'm doing a list
How do you trigger a javascript function using actionscript in flash? The goal is
I often want to trigger a certain function just once, but I need to
$(#table_exams tbody tr).click(function (event) { window.location.href=# +$(this).attr(exam_ID); window.location.href=/medilab/prototypes/exams/edit?examId= + $(this).attr(exam_ID) +&referer= + referer; row_select(this);
When I bind a function to a checkbox element like: $(#myCheckbox).click( function() { alert($(this).is(:checked));
I'm currently trying to do the following: Trigger: click on a name in a

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.