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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:45:32+00:00 2026-05-16T01:45:32+00:00

There’s a div2 here that has transparency using a css style tag. However the

  • 0

There’s a div2 here that has transparency using a css style tag. However the transparency goes away after toggle. It seems to work fine with toggle() but not toggle([number]).

Any fixes? Thanks guys.

doesn’t work in IE7 OR FF 3.5

CSS

.transparentDiv
{
    filter:alpha(opacity=50);

    background-color:#d5ffd5;
    height:800px;
    width:300px;
}

CODE

<input type="button" id='btn1' value="Hide Something" />
     <div style=" background-image:url('../../images/bg.jpg'); background-repeat:repeat-x; border-style:solid;height:1000px;width:100%">
         <div id="div3" class="transparentDiv" style=" margin-top:30px; padding-left:300px;background-color: #4ddfff; height: 100px;position:absolute; width:950px">
     <br />
     <br />
     <br />

         </div>
        <div id="div2" class="transparentDiv"  >




         <h1></h1>



        </div>

    </div>


    <script src="http://jquery.com/src/jquery-latest.js"></script>
     <script type="text/javascript">

         $(function() {

             $("#table1 tbody tr:even").addClass('zebra');
             $("#btn1").click(function() {

                 $('#div2').toggle(400); return false;
             });

         });





     </script>
  • 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-16T01:45:33+00:00Added an answer on May 16, 2026 at 1:45 am

    its because you use $('#div2').toggle(400); it is fading + sliding, i think the browser (IE) overwrites the value when animating so when toggling back, it just goes up.

    EDIT: possible solutions

    • 1: use slideFadeToggle form this blog:

      $('#div2').slideFadeToggle(400);
      //With this (small) jquery plugin
      jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
         return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 
      };
      

      EDIT2: found out this is not really working in IE either… if you really want the fade you have to do it manually, eg check if the div is active then toggle(400) else animate({…},400)

    • 2: just use the build in slideToggle, it uses no fading:

      $('#div2').slideToggle(400);
      

    Good luck

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

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
There is a website called Gild.com that has different coding puzzles/challenges for users to
There is a statement in the foudations of Qt Development book that goes as
There is a moment in my app, that I need to force to show
There is a column that exists in 2 tables. In table 1, this column
There are a lot of blogs saying that a hasOwnProperty check should be used
I've got a string that has curly quotes in it. I'd like to replace
There's a few previous questions on StackOverflow questioning how one goes about accessing local
There is no doubt that MonoTouch is one of the great cross-compiler(s). Similarly, SenchaTouch
There are some stdlib functions that throw errors on invalid input. For example: Prelude>

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.