Issues with slideToggle in IE8 caused by CSS in JQuery

I am facing an issue where my div elements are supposed to toggle visibility using jQuery's "slideToggle" function (I'm utilizing jquery-1.2.6.min.js). This functionality is working as expected! However, I am encountering a problem specifically with CSS in IE 8. There are times when my "title divs (elements with black backgrounds)" get stuck together, although this does not happen consistently.

You can view an example at

Is there anyone who could provide assistance? Or shed some light on what might be causing the difference in behavior between IE8 and other versions of Internet Explorer?

Here is my jQuery code:

$(document).ready(function(){
                    $("div.tekst1").toggle();
                    $("div.tekst2").toggle();
                    $("div.tekst3").toggle();
                    $("div#titel1").click(function(event){
                        $("div.tekst1").slideToggle('slow');
                        if ( $("div.tekst2").is(':visible') ) {
                            $("div.tekst2").slideToggle('1500');
                        }
                        if ( $("div.tekst3").is(':visible') ) {
                            $("div.tekst3").slideToggle('1500');
                        }
                    });
                    $("div#titel2").click(function(event){
                        $("div.tekst2").slideToggle('slow');
                        if ( $("div.tekst1").is(':visible') ) {
                            $("div.tekst1").slideToggle('1500');
                        }
                            if ( $("div.tekst3").is(':visible') ) {
                            $("div.tekst3").slideToggle('1500');
                        }
                    });

                    $("div#titel3").click(function(event){
                        $("div.tekst3").slideToggle('slow');
                        if ( $("div.tekst1").is(':visible') ) {
                            $("div.tekst1").slideToggle('1500');
                        }
                            if ( $("div.tekst2").is(':visible') ) {
                            $("div.tekst2").slideToggle('1500');    
                        }
                    }); 
                });

This is my CSS styling:

.item{
    width:200px;
    font-size:12px;
    font-family:arial;
    margin-bottom:10px;
    }
#titel1, #titel2, #titel3{
    background-color:#000;
    text-transform:uppercase;
    color:#fff;
    cursor:pointer;
    margin-bottom:5px;
    margin-top:5px;
    }
.titel1{
    margin-top:0px;
    }
.tekst1, .tekst2, .tekst3{
    margin:0px;
    }

Answer №1

It seems like you're referring to the issue discussed in this post: IE8 bug with slideToggle causing margins to disappear

Simply adding overflow:hidden to the divs where the margins are disappearing should resolve the issue. Take a look and let me know if it works for you!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Guide on incorporating Bootstrap 4 beta.2 into an Angular 4 project

After attempting to install Bootstrap 4 version beta.2 along with its dependencies (jquery and popper.js), I encountered a strange problem. A SyntaxError message kept appearing in the console, specifically stating "SyntaxError: export declarations may only ...

What is the best way to add a -webkit-transform to a div without affecting its enclosed elements?

Is there a way to apply a webkit transformation to a div without affecting the text inside? I need help with achieving this. Below is my current code: .main_div { width:200px; height:100px; background:red; margin-left:55p ...

The web service method is supposed to return JSON data, but when the response object is received in the callback function of my $

Presenting my custom Serialization class: public class JsonConverter { private StringBuilder json; public JsonConverter() { json = new StringBuilder(); } public JsonConverter AddObjectType(string className) { json ...

I keep getting double results from the Multiple Checkbox Filter

Currently, I am facing an issue with a checkbox filter on a product page that I'm developing. The filter is functioning correctly, but I encounter duplicate results when an item matches multiple criteria. For instance, if I select both 'Size 1&ap ...

Tips for customizing the CSS styling of the validation ng-class error

Seeking advice: Is there a way to customize the CSS style of the 'error' validation error for ng-class in Bootstrap v3? This is my current code: ng-class="(form.datos.$invalid) && ( form.datos.$touched || submitted) ? 'error&apos ...

Obtain the bounding box of an SVG element while it is not visible

I've been grappling with this issue for more than a day now, but I'm still unable to find a solution. My challenge lies in the need to scale an SVG image for responsive design purposes. Since I have to manipulate the SVG code on the client side, ...

Is it possible to identify a legitimate JSONP response?

My goal is to exchange data with a web service on a separate server that lacks CORS support. I am required to utilize JSONP for this purpose. The service mandates authentication, and when the user is in an SSO environment, they are seamlessly passed throug ...

Tips for dynamically inserting a new column into a table at any position other than the beginning or end

I have created a dynamic table where rows and columns can be added dynamically. However, I am facing an issue where I am unable to add a new column between the first and last column of the table. Currently, new columns are only being added at the end. $ ...

Internet Explorer 7 has been selected, a dropdown menu appearing over another dropdown

Hey everyone, I could really use some help with this issue. I'm currently working with chosen.js and I'm having some trouble with dropdowns. Please take a look at this picture for reference: problem with dropdowns Below is the HTML code I'm ...

Validation of dynamically generated name fields using radio button group

CODE: html <form id="myform" type="post"> <fieldset id="myid1"> <input id="entries_8490_burn_id_1" name="entries[8490][burn_id]" value="1" type="radio"/> <input id="entries_8490_burn_id_2" name="entries[8490][burn ...

To enhance the menu's appearance, apply a bottom box shadow when scrolling both up and down

My menu has the following CSS properties: #header { width: 100%; position: fixed; z-index: 9000; overflow: auto; } With these CSS properties, the element #header will always stay on top, regardless of scrolling. My goal is to add a bottom box sha ...

elements that do not adhere to set width constraints

I've successfully arranged elements in my HTML using flexbox to achieve a responsive design for a website. However, I've encountered an issue where the elements do not resize properly. After applying a class of flex to the home-promos div and re ...

Having trouble with Vue.js implementation of Bootstrap tab navigation?

I am currently working on a vue.js application that consists of 2 routed components. I recently attempted to integrate a bootstrap tab navigation into the first component, but unfortunately, the tab contents are not being properly displayed. <templat ...

Troubleshooting issue with Bootstrap's responsive scrollspy functionality

I am experiencing an issue with the responsiveness of my page. When I reduce the width of the page to half, the scrollspy disappears unexpectedly. I am unsure about the root cause of this problem. If you run the code I have shared here, you can observe th ...

Using JQuery to generate dynamic URLs for Flask application

Presently, my form consists of filters. I am returning a serialized version of this form using the following code: $.fn.serializeObject = function() { var o = {}; var a = this.serializeArray(); $.each(a, function() { if (o[this ...

Sorting table tbody elements created dynamically with JavaScript on an npm webpack application is not possible with jQuery UI

My JS-built table is populated with data from a JSON file fetched after a request. I want to be able to drag and drop these tbodys and update the JSON file accordingly. To handle sorting, I decided to use jquery-ui. While .sortable() works well for drag a ...

Is your text appearing vertically in Internet Explorer?

I'm having an issue with my small single page website where the text in a form is displaying vertically instead of horizontally in Internet Explorer. The problematic part is related to "vehicle condition." Any suggestions on what I might be doing wron ...

Attempting to use jQuery AJAX to submit data without navigating away from the current webpage

Trying to implement the solution provided in this post where I am trying to send data to a PHP page and trigger an action, but unfortunately, it seems to just refresh the page without any visible outcome. Even after checking the network tab in the element ...

Creating an image slideshow with a looping JavaScript array: Step-by-step guide

One issue with the program is that when it runs, only the last array value image is displaying on the screen while the other images are not. Below is the HTML code: <img id="mg" alt="image not found"> And here is the JavaScript code: var images=[ ...

Creating a search bar with a basic text input and submit button using Flask

Whenever I click on submit, I expect the form to transfer the value to the server. However, I keep encountering a 500 internal server error. Check out my views.py code below: from app import app from flask import render_template, request import feedparser ...