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

  • Home
  • SEARCH
  • 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 6891221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:22:57+00:00 2026-05-27T06:22:57+00:00

I am designing a responsive layout with a carousel. The carousel has a control

  • 0

I am designing a responsive layout with a carousel. The carousel has a control that allows the user to toggle the entire box, hiding and showing the carousel. You can see this fully working here: http://pixelcakecreative.com/cimlife/responsive2/

It seems like it is functioning very sluggishly. I was thinking that my jquery was written poorly, and it might be slowing the performance down. My jquery is as follows:

$("#closeBox a").click(function(){
            if ($(this).find('span').hasClass('minus')) {
               $(this).find('span').removeClass('minus').addClass('plus');
               $(".padCar").css("padding-bottom","0");

            } else if ($(this).find('span').hasClass('plus')) {
                 $(this).find('span').removeClass('plus').addClass('minus');
                 $(".padCar").css("padding-bottom","20px");
            }
            $('#carousel').slideToggle('slow');

        return false;
        });

Any ideas why it is so jumpy? Perhaps my jquery should be better written, or maybe it is something else on the page that causes this?

  • 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-27T06:22:58+00:00Added an answer on May 27, 2026 at 6:22 am

    Well first off you need to cache your selectors, so you should use

    var span = $(this).find('span');
    

    And then just use span.someFunction(); – this reduces DOM queries and will speed it up.

    Also what about adding a context to your initial selector? So if you know the links you are targeting are within a div with a class of .myBox, use:

    $('#closebox a', '.myBox')
    

    Or even better, use delegate():

    $('.myBox').delegate('#closebox a', 'click', function(){ ... });
    

    Update

    As John Hartsock and RightSaidFred pointed out, if using v1.7+, you should use on() rather than delegate(), as so:

    $('.myBox').on('click', '#closebox a', function(){ ... });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm designing a server daemon for a project that has to take a large
I'm working on designing a REST API that can respond with a variety of
Of late, I've been designing sites that are more responsive and I've been using
I am designing a website using the CSS fluid layout (based on adaptive/responsive web
I am designing a responsive layout and have positioned a grungy png overlay on
We're designing a web user control, which does some different things. It gets events
I'm designing a RESTful API that currently has resources that include some elements that
Designing forms has always been fun, but getting them to send email on the
When designing a database to use MVCC (Multi-Version Concurrency Control), you create tables with
While designing a table my colleague here says that I should avoid identity column

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.