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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:34:38+00:00 2026-05-30T14:34:38+00:00

I’m having trouble with the show()/hide() function of jQueryUI. They basically deactivate my CSS

  • 0

I’m having trouble with the show()/hide() function of jQueryUI. They basically deactivate my CSS for the duration of the animation.

jsFiddle link: http://jsfiddle.net/UBATE/1/

According to the API:

http://docs.jquery.com/UI/Effects/Drop,

I’ve built the following function:

updateTeamLists = function(args) {
    // fade out -> rebuild the content -> fade in

    $("#team1, #team2").hide("drop", {"direction": "right"}, 600, function() {
        rebuildTeamLists(args); 
        $(this).show("drop", {"direction": "right"}, 600);  
    });     
};

The child DOM nodes appear to lose all their CSS attributes in the beginning of the animation, i.e. they stop floating (or lose their inline-block display) and their backgrounds vanish instantly. However, the animation and the fading out of the text work fine.

HTML DOM structure:

<div id="teams">
   <div id="team1">
      <ul>
         <li>Player 1</li>
         <li>Player 2</li>
         <li>Player 3</li>
         <li>Player 4</li>
         <li>0 Pts</li>
      </ul>
   </div>
   <div id="team2">
      <ul>
         <li>Player 5</li>
         <li>Player 6</li>
         <li>Player 7</li>
         <li>Player 8</li>
         <li>0 Pts</li>
      </ul>
   </div>
</div>

CSS:

#content > #teams {
    margin-top: 10px;
    padding: 5px 5px 5px 22px;
    width: 650px;
    border: 2px solid #bfbfbf;

    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;

    box-sizing: border-box; 
    -moz-box-sizing:border-box;
}

#content > #teams > div {
    margin-top: 5px;
    display: block;
    height: 28px;
}

#content > #teams > div:first-child {
    opacity: 1.0;   
}

#content > #teams > div:last-child {
    opacity: 0.6;
}

#content > #teams > div > ul > li {
    height: 25px;
    width: 125px;
    border-width: 1px;
    border-style: solid;
    margin-left: 5px;   
    display: inline-block;
}

#content > #teams > div > ul > li:first-child {
    -webkit-border-top-left-radius: 20px;
    -webkit-border-bottom-left-radius: 20px;
    -moz-border-radius-topleft: 20px;
    -moz-border-radius-bottomleft: 20px;
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}

#content > #teams > div > ul > li:last-child {
    -webkit-border-top-right-radius: 20px;
    -webkit-border-bottom-right-radius: 20px;
    -moz-border-radius-topright: 20px;
    -moz-border-radius-bottomright: 20px;
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;

    width: 50px !important;
}

#content > #teams > #team1 > ul > li {
    background: rgb(229,130,130); /* Old browsers */
    background: -moz-linear-gradient(top, rgb(229,130,130) 0%, rgb(216,43,43) 51%, rgb(232,153,153) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgb(229,130,130)), color-stop(51%,rgb(216,43,43)), color-stop(100%,rgb(232,153,153))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, rgb(229,130,130) 0%,rgb(216,43,43) 51%,rgb(232,153,153) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, rgb(229,130,130) 0%,rgb(216,43,43) 51%,rgb(232,153,153) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, rgb(229,130,130) 0%,rgb(216,43,43) 51%,rgb(232,153,153) 100%); /* IE10+ */
    background: linear-gradient(top, rgb(229,130,130) 0%,rgb(216,43,43) 51%,rgb(232,153,153) 100%); /* W3C */
    border-color: rgb(229,130,130);

    text-align: center;
    padding-top:3px;
}

#content > #teams > #team2 > ul > li {
    background: #b3dced; /* Old browsers */
    background: -moz-linear-gradient(top, #b3dced 0%, #29b8e5 50%, #bce0ee 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b3dced), color-stop(50%,#29b8e5), color-stop(100%,#bce0ee)); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* IE10+ */
    background: linear-gradient(top, #b3dced 0%,#29b8e5 50%,#bce0ee 100%); /* W3C */
    border-color: rgb(179,220,237);

    text-align: center;
    padding-top:3px;
}

Unfortunately I can’t host the code online for a demo so I’ve posted up anything I got. I’m using Google Chrome 17.0.963.56 and Firefox 10.0.2.

I’m quite often having trouble with adding jQueryUI effects to my scripts, ending up not adding them. Though there might be some tricks/bugs preventing it from working (e.g. if your DOM node didn’t have a class attribute, toggleClass animations wouldn’t work).

Did I miss something? How would a workaround look like, would I have to iterate through all the child nodes?

Thanks in advance!

Harti

  • 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-30T14:34:40+00:00Added an answer on May 30, 2026 at 2:34 pm

    Jquery UI will add an extra div under the effected element. Example:

    <div id="team1">
    <ul>
      ...
    <ul>
    </div>
    

    When the effect is applying, the structure will be:

    <div id="team1">
    <div class="jquery-ui something-else">
    <ul>
      ...
    </ul>
    </div>
    </div>
    

    The solution is not to use the direct-child selector “>”. See example here. You can compare it with your version 🙂

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need a function that will clean a strings' special characters. I do NOT
I want to construct a data frame in an Rcpp function, but when I
I am using Paperclip to handle profile photo uploads in my app. They upload
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.