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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T13:56:02+00:00 2026-05-29T13:56:02+00:00

I am using the below test code to toggle a div based on a

  • 0

I am using the below test code to toggle a div based on a radio button selection.
The problem is when the div slides back up, there is an annoying jerk I notice
only in IE8. The same code works well in Firefox.

I tried changing the DOCTYPE to the one I am using in the test code below.

Could someone suggest how to eliminate the jerk / flicker in IE when the div slides up?

Below is the sample code I am testing with.

Thanks for any help!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org /TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<style>
.div3{
width: 300px;
height:40px;
border: 1px solid blue;
}
.div4{
width: 300px;
height:80px;
border: 1px solid red;
}
</style>

<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">

    $(document).ready(function(){

        $('[value="myDiv_3"]').attr('checked',true);
        $('.div3').show();

        $('input[name="myRadio"]').change(function(){
            var selected = $(this).val();
            $('.div3').slideUp(3000);
            $('#'+selected).slideDown(3000);
        });
    });
</script>
</head>


<body style="text-align:center;">
<form action="example.com" method="post">
    <input type="radio" name="myRadio" value="myDiv_3" />MyDiv3
    <input type="radio" name="myRadio" value="myDiv_4" />MyDiv4
</form>
<div id="myDiv_3" class="div3">Div number 3!</div>
<div id="myDiv_4" class="div4">Div number 4!</div>
</body>
</html>
  • 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-29T13:56:03+00:00Added an answer on May 29, 2026 at 1:56 pm

    It looks like there is a glitch because, when selecting the first radio button called MyDiv3, the following code tells the same div to slide up and down at the same time.

    $('input[name="myRadio"]').change(function(){
         var selected = $(this).val();
         $('.div3').slideUp(3000);
         $('#'+selected).slideDown(3000);
    });
    

    Not exactly sure what your final effect is supposed to be and assuming the rest of the code is what you intended, you can try this…

    $('input[name="myRadio"]').change(function(){
         var selected = $(this).val();
         if (selected === 'myDiv_3') {
             $('#myDiv_3').slideDown(3000);
         } else {
             $('#myDiv_3').slideUp(3000);
         }
    });
    

    Demo: http://jsfiddle.net/wMfFe/2/


    EDIT after seeing OP’s demo page:

    In the page source…

    <!-- http://www.bennadel.com/blog/2263-Use-jQuery-s-SlideDown-With-Fixed-Width-Elements-To-Prevent-Jumping.htm -->
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    

    The OP’s demo page is slipping IE8 into quirks-mode because the doctype is not the very first line in the file. The doctype must always come first. Using the tools at F12 verifies active quirks-mode, and then forcing IE8 Standards Mode fixes the jerky animation issue.

    Removing everything above doctype including the empty space will prevent IE8 from slipping into quirks-mode as long as the rest of the page is also properly validated.

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

Sidebar

Related Questions

I have a strange problem, I'm using the code below to test for a
I am using the below example code and have a problem where I can't
Thanks in advance. Getting this warning when using below code: Warning: file_get_contents(test.php) [function.file-get-contents]: failed
Look at the test code I have written below. Using pure java I set
I have a small script which im using to test PHP mail(), as below:
i am using below code to change the the font type of text view.
Currently i'm using below code which works well. $(#topperAtBaseLevel:visible, #lowerAtBaseLevel:visible, #midAtBaseLevel).hide(); any optimised code?
I am using below code to create a reminder in Google calendar (using Google
In past, I am using Listview and using below code can show a particular
I want to enable auto update script in flex3. i am using below code

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.