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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:31:48+00:00 2026-06-08T10:31:48+00:00

hi i want to write if statement which is checking if div dont hasClass

  • 0

hi i want to write if statement which is checking if div dont hasClass and if dont has it script should add it using toggleClass (i’m useing jquery ui), i wrote script above whitch is working almost fine but the first (this) should point to (.apla) that has not “min” class and the second (this) should point (.apla) with clicked (.arrow)

point of this is to check if any (.apla) is open and if any (.apla) is open script should close it using toggleClass (with animation), and after this script should open clicked (.apla) also using toggleClass, could u help me pls

fiddle – http://jsfiddle.net/eNqew/

JS

$('.arrow').click(function(){
    if (!$(".apla").hasClass("min")) {
    $(this).toggleClass("min", "slow");
    } else {
    $(this).parent().parent().toggleClass("min", "slow");
    }
});

UPDATE JS works almost

$('.arrow').click(function(){
        if (!$("#apla01").hasClass("min")) {
            $("#apla01").toggleClass("min", "slow");
        }
        if (!$("#apla02").hasClass("min")) {
            $("#apla02").toggleClass("min", "slow");
        }
        if (!$("#apla03").hasClass("min")) {
            $("#apla03").toggleClass("min", "slow");
        }
        else {
            $(this).parent().parent().toggleClass("min", "slow");
        }
    });

HTML

<div id="apla01" class="apla min">
    <div class="apla-wraper">
        <div class="arrow"></div>
    </div>      
</div>
<div id="apla02" class="apla min">
    <div class="apla-wraper">
        <div class="arrow"></div>
    </div>      
</div>
<div id="apla03" class="apla min">
    <div class="apla-wraper">
        <div class="arrow"></div>
    </div>      
</div>

CSS

#apla01.apla.min {
    z-index: 5;
    left: -800px;
}
#apla02.apla.min {
    z-index: 4;
    left: -760px;
}
#apla03.apla.min  {
    z-index: 3;
    left: -720px;
}
.apla {
    width: 838px;
    height: 634px;
    position: absolute;
    top: 20px;
    left: 0;
    background: url(../img/bgApla.png) no-repeat -5px center;
}
.apla.min {
}
.apla-wraper {
    position: relative;
    width: 100%;
    height: 100%;
}
.arrow {
    width: 28px;
    height: 28px;
    background: url(../img/arrow.png) no-repeat 0 0;
    position: absolute;
    top: 50%;
    right: -10px;
    margin-top: -14px;
    cursor: pointer;
}
.apla.min  .arrow{
    background: url(../img/arrow.png) no-repeat -28px 0;
}
  • 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-08T10:31:50+00:00Added an answer on June 8, 2026 at 10:31 am

    Try this :

    $('.arrow').click(function(){
        var $currentApla = $(this).parent().parent()
        $('.apla:not(.min)').not('#'+$currentApla.attr('id')).toggleClass("min", "slow");
        $currentApla.toggleClass("min", "slow")
    });
    

    Hope this helps 🙂

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

Sidebar

Related Questions

I want to write a function in PL/SQL, which has a sql-statement as parameter.
I want to write a batch script statement where: FINDSTR has to check for
I want to write statement, in which I will check runs that script from
I want to write a mysql statement which will return a list of results
I want to write an if statement of an uiimageview to see which image
I want to write infinity while statement which will perform every time when user
Has anyone tried to dynamically select which properties they want to write to an
I am testing something. I want to write a statement in my stored procedure
I want to write a SELECT statement as follows: SELECT field_a FROM my_table WHERE
I want to write an SQL statement like below: select * from tbl where

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.