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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T12:21:50+00:00 2026-06-16T12:21:50+00:00

I need to animate the div ‘introduction’ to make its height and width zero

  • 0

I need to animate the div ‘introduction’ to make its height and width zero when clicked on the link ‘click here to begin’, which works. Another div ‘theTest’ needs to fade in at the same event. Unfortunately it is not working.
I am new to YUI and I used this as the source.

jsFiddle: http://jsfiddle.net/pV8eT/1/

Code:

(function() {
    var introductionAttributes = {
        width: { to: 0 },
        height: { to: 0 }
    };
    var theTestAttributes = {
        visible: { to: true },
        width: { to: 500 },
        height: { to: 500 }
    };
    var introductionAnim = new YAHOO.util.Anim('introduction', introductionAttributes);
    var theTestAnim = new YAHOO.util.Anim('theTest', theTestAttributes);

    YAHOO.util.Event.on('startTest', 'click', function() {
        introductionAnim.animate();   //this works
        theTestAnim.animate();        //this doesnt work :(
    });
})();

How do I modify the code to fade in the div “theTest” ?

  • 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-16T12:21:51+00:00Added an answer on June 16, 2026 at 12:21 pm

    My guess is that the issue is with display: none and visibility. But I wouldn’t know how to fix it because my YUI 2 knowledge is limited.

    Here how I’d do it in YUI3:

    YUI().use('transition', function (Y) {
      var introduction = Y.one('#introduction'),
          test = Y.one('#theTest');
    
      Y.one('#startTest').on('click', function (e) {
        e.preventDefault();
    
        introduction.transition({
          width: 0,
          height: 0
        });
        // first set display to block, then change opacity
        // so it fades in
        test.setStyle('display', 'block').transition({
          opacity: 1
        });
      });
    });
    

    I also added opacity: 0 to the CSS style of #theTest.

    Here’s a working example: http://jsbin.com/odujer/1

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

Sidebar

Related Questions

I need two DIV layers with height & width:100% each and when I click
Problem: I've a box(div) with fixed width but unknown (auto) height. I need to
I need to make the 'content' div animate after the inner divs fade out.
i am trying to animate a div , what i need is when click
Header $(document).ready(function() { $('#user_box').animate({width: 263px}, slow); $('#submit').click(function(){ $('#user_box').animate({width: 0px}, slow); }); }); Content <div
I need to animate the height attribute of iframe, but seems like the animate
I need to make an image view animate it's self on and off of
Only yesterday did I need to animate the border color of an HTML div
JQUERY, div with a fixed height (with a scrollbar) how to animate until it
I am creating div's animation as http://tententen.in/ $(document).ready(function(){ $('#home-top').click(function() { $('#top').animate({ marginTop: '50px' },500);

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.