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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:22:29+00:00 2026-06-17T14:22:29+00:00

I am trying to accomplish what may be a simple task for you. I

  • 0

I am trying to accomplish what may be a simple task for you. I want it so everytime the user clicks one of the “patients” on the left hand bar, a drawer opens. That drawer will be loaded in a hidden div (display:none) on the page. Each div’s id will be the last lastname of the patient. My included fiddle shows all of the same last name for demonstration purposes only, obviously.

But the problem is I don’t know how to open a unique drawer for each patient. I guess I need to put a toggle on each patient’s li somehow?

Also, if they click another patient in the listing, I would like the current open drawer to close, and open the one they just clicked. Also, if the close button is clicked, obviously close the drawer as well.

I got a single drawer to work with this:

 $(".patient").toggle(function(){
            $(this)
                $('#drawer').slideDown("slow")

            }, function(){
                $(this)
                $('#drawer').slideUp("slow")    

            });

But obviously that isn’t going to work… 🙁

In the fiddle it is opening a standard “drawer” right now. but really I’d like the data for each named div be loaded in the same form. Please comment if you don’t understand.

Here’s the fiddle:

http://jsfiddle.net/3veht/1/

  • 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-17T14:22:30+00:00Added an answer on June 17, 2026 at 2:22 pm

    Add a data element to your HTML indicating an ID, let’s say patient ID in this case:

    <li class="patient green" data-patientId="1">Josh Doe<img src="img/next.png"><img class="imgfix" src="img/accept.png"></li>
    <li class="patient red" data-patientId="2">John Adams<img src="img/next.png"><img class="imgfix" src="img/cancel.png"></li>
    

    Then in your javascript when you load the data, you can use that ID to generate a page request. I also changed the toggle to a click and slid the previous one up before sliding the new one down. In the fiddle example:

     $(".patient").click(function(){
         var pat = $(this);
         if ($("#drawer").is(":visible"))
             $("#drawer").slideUp("fast", function () {
    
                $('#drawer').slideDown("slow")
                $("#drawer").load("/echo/js?js=" + pat.data("patientid"));       
             });
         else   
         {
             $('#drawer').slideDown("slow")
             $("#drawer").load("/echo/js?js=" + pat.data("patientid"));
         }
     });
    

    Updated fiddle: http://jsfiddle.net/3veht/6/

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

Sidebar

Related Questions

I'm trying to accomplish one simple task (but is not simple for me). I
I'm trying to accomplish a simple task of creating a database with 2 tables
One user may have just 1 item or none. (1-1..0 relationship) I'm trying to
Im trying to accomplish something which may seem a bit convoluted but would be
I'm trying to accomplish a simple thing. I have a 2 levels menu with
I'm trying to accomplish the following task. I'm developing a custom calendar with three
Hey everyone. I am trying to incorporate a simple UINavigationController into my tab bar
I think my problem may be quite simple, but after trying different approaches I
I am trying to determine the best time efficient algorithm to accomplish the task
I am trying to accomplish the following element declaration: The XML element may consist

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.