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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:24:20+00:00 2026-05-19T03:24:20+00:00

Disclaimer: I am new to jQuery. I am trying to implement a fadeOut effect

  • 0

Disclaimer: I am new to jQuery.

I am trying to implement a fadeOut effect in jQuery for a div block, and then fadeIn effect on two other div blocks.

However, these effects are only working in the Chrome browser (i.e. they won’t work in Safari, FireFox, Opera) which is rather perplexing to me. I have tried clearing my cache in case it was storing an old file, but none of that seemed to do anything.

Basic idea (stored in mainsite.js file):

$("#videoThumbnail_XYZ").click(function () {
  $("#thumbnailDescription_XYZ").fadeOut(300);
  $("#videoPlayer_XYZ").delay(300).fadeIn(100);
  $("#videoHiddenOptions_XYZ").delay(300).fadeIn(100);
  });

So when a div tag with the id of videoThumbnail_XYZ is clicked, it starts the fadeOut and fadeIn calls on the other div tags.

I am loading my javascript files into the page in this order (so jQuery is loaded first):

<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
<script async="" type="text/javascript" src="javascripts/mainsite.js"></script>  

Any guidance you could give is greatly appreciated!

  • 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-19T03:24:21+00:00Added an answer on May 19, 2026 at 3:24 am

    Make sure the DOM is fully loaded before your code runs.

    A common way of doing this when using jQuery is to wrap your code like this.

    $(function() {
        $("#videoThumbnail_XYZ").click(function () {
          $("#thumbnailDescription_XYZ").fadeOut(300);
          $("#videoPlayer_XYZ").delay(300).fadeIn(100);
          $("#videoHiddenOptions_XYZ").delay(300).fadeIn(100);
        });
    });
    

    This is a shortcut for wrapping your code in a .ready() handler, which ensure that the DOM is loaded before your code runs.

    If you don’t use some means of ensuring that the DOM is loaded, then the #videoThumbnail_XYZ element may not exist when you try to select it.

    Another approach would be to place your javascript code after your content, but inside the closing </body> tag.

    <!DOCTYPE html>
    <html>
        <head><title>your title</title></head>
        <body>
            <!-- your other content -->
    
            <script src="http://code.jquery.com/jquery-1.4.4.js"></script>
            <script async="" type="text/javascript" src="javascripts/mainsite.js"></script>  
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Disclaimer: I'm fairly new to python! If I want all the lines of a
Disclaimer: the following is a sin against XML. That's why I'm trying to change
Disclaimer : I am new to C# and WPF and adding features to existing
Disclaimer : I am totally new to Ruby on Rails but planning learning it.
Disclaimer: This is a follow-on question from my other question about NServiceBus which was
Disclaimer: This is not actually a programming question, but I feel the audience on
Disclaimer: I'm stuck on TFS and I hate it. My source control structure looks
Disclaimer Yes, I am fully aware that what I am asking about is totally
Disclaimer: This is for a homework assignment, but the question is not regarding the
DISCLAIMER: The following code is not something I would ever use in a real

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.