Complications arising from IE when using strict doctype with CSS and jQuery

Here's the code I'm using for a sliding caption effect on my gallery site:

I specifically implemented the last effect which is the Caption Sliding (Partially Hidden to Visible).

$('.boxgrid.caption').hover(function(){
  $(".cover", this).stop().animate({top:'185px'},{queue:false,duration:160});
}, function() {
  // ending position of the caption... measured from top.
  $(".cover", this).stop().animate({top:'228px'},{queue:false,duration:160});
});

Currently, I'm trying to add Shadow box for a full view of each image:

However, when I include the doctype declaration in my page:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">

The sliding captions are not behaving as expected in IE. They initially appear at the top of the caption box and then move to their correct position only after hovering over them. The starting position defined in the CSS:

.caption .boxcaption {
   /* Starting position of the caption box. Measured from the top of the image box */
    top: 228;
    left: 0;
}

This doesn't seem to work properly with the doctype declaration. Removing the doctype makes the sliding captions work correctly, but other lightbox popups like shadowbox require it to function properly...

This issue seems to be specific to IE, as everything works fine in FF and Chrome.

Any ideas or suggestions on how to resolve this?

Answer №1

position: absolute;

position: absolute;

Utilizing tools like the CSS Validator can help prevent common mistakes in your code.

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

Crafting visually stunning interfaces with Material UI

I'm a beginner in Material Design and I could use some assistance with the following structure. Can anyone guide me on how to create this? https://i.stack.imgur.com/NpiVz.png I've managed to add a text box, but now I'd like to place a label ...

Having trouble connecting to CSS in a node.js HTML document

My website is encountering an issue where the CSS fails to load, and I am receiving the following error message: Refused to apply style from 'http://localhost:5000/server/nodeClient/public/css' because its MIME type ('text/html') is not ...

Content in TinyMCE styled with the default CSS of the application

Hello fellow developers; I'm struggling to find a suitable solution to apply the same styles from our main CSS file to the text entered in the TinyMCE editor. Just to clarify, I don't want to alter the overall theme or appearance of TinyMCE itse ...

dispatch email display Twitter Bootstrap notification utilizing Ajax

I'm trying to set up an email sending feature via a contact form. I want it to send the email and display a Bootstrap alert confirming that the email has been sent. Below is the HTML code: https://jsfiddle.net/6rfeas35/. Additionally, here is my PHP c ...

Is it possible to create a dynamic drop-down list in PHP using an array?

In the image above, a new row will be added when the user clicks on the [add more] button. While this functionality works perfectly, I would like to send these values using AJAX. I am able to access all textbox values with the array map function in AJAX ex ...

There is a lack of a responsive page after being redirected from Facebook

Having an issue with responsiveness on my website at . When I access a webpage from the browser on my smartphone, the site is fully responsive. However, when I try to open it from a link in Messenger, it appears like the PC version shrunk down to fit a mob ...

Substitute the content within an <li> tag

Is there a way to replace or entirely remove - undefined without using substr()? The value of 'name' is dynamic and constantly changing. Any suggestions would be greatly appreciated. <li>name - undefined</li> <li>name - undefin ...

Is there a way to eliminate a div and all its contents from the DOM?

As I work on my web application, I am trying to implement a system where error messages can be returned via ajax upon success or failure. The ajax script is functioning correctly in terms of returning errors or successes. However, my challenge lies in com ...

Eliminate the navigation bar background using MaterializeCSS

I want to create a unique extended navigation bar for my website that has the following structure: <nav class="nav-extended"> <div class="nav-wrapper"> <ul id="nav-mobile" class="right hide-on-med-and-down"> <li><a ...

The fusion of Combining Forms, JSON, AJAX, PHP, and Google graphs

I'm completely new to integrating JScript, Ajax, and Google Graphs. Although I've managed to get each of them working separately, combining them has proven to be quite challenging. Google Graph Part of my code (Form is inactive here): <html& ...

Issue with Backbone: Browser button failing to activate routes

Recently, I have been working on a web application using backbone, jQuery, and the BAAS of stackmob. However, I've encountered an issue where browser buttons do not trigger the backbone routes as expected. Despite successfully navigating from one view ...

Obtain the value of key2 when the value of key1 is matched?

Here is a JSON object with different colors and quantities. How can you select the quantity based on the color selected by the user from a dropdown menu? { "products": [{ color: "yellow", qty: 22 }, { color: "red", ...

Implementing the jQueryUI checkboxradio feature across all checkboxes within an entire ASP web application

I have a collection of Checkboxes in my ASP Webform app. I want to implement the jQuery UI checkboxradio() for all checkboxes in my app. To achieve this, I have added the following code in my Site.Master file. However, it is not functioning properly, even ...

Discover the method for tracking idle time with jQuery and PHP

I have a script that utilizes PHP sessions through a custom class. One of the methods in this class calculates the remaining seconds before the session expires. Whenever the user refreshes the page or opens a new one, the idle time counter is reset using ...

Is it possible to trigger a method on the current PHP page as well as a method in another PHP script at the same time when submitting a form using jQuery Ajax

Can someone assist me? I am new to PHP and feeling overwhelmed with the PHP request process. Implementing an MVC structure for view, I have created an HTML form. When the form is submitted, I need to execute two different methods - sendMail() and validate ...

Html content overlapping div rather than being stacked vertically

My goal is to arrange a group of divs inside another div in a vertical stack. However, I am facing an issue where the text from the last div is overlapping with the second div instead of following a proper vertical alignment where the text in the third div ...

The side modal features a full-height design with headers, bodies, and footers that are

I have created a side modal that extends to full height. The content in the modal body is quite lengthy, but I am facing an issue where the header, body, and footer are not equal in size. I am considering using scrollspy on the HTML body tag to potentially ...

Elements in Internet Explorer become unresponsive after being hidden or shown using jQuery

One issue I'm encountering is with a group of tabbed divs that I'm using jQuery hide() and show() to toggle the visibility. This method functions perfectly in most browsers, but unfortunately in Internet Explorer (IE), the hidden tabs become unre ...

Is it possible to use combox to deactivate the buttons?

My goal is to deactivate the button as soon as I select a value from the drop-down list. For example, here's what I have: <select name =""> <option> disable </option> <option> enable </option> </select> <input ...

Using jQuery Datatables fnReloadAjax successfully triggers a reload of the data, however, it

In my jQuery datatable, I am utilizing the code below to refresh the data: $(".unread-rows").click( function(e) { e.preventDefault(); message_table.fnReloadAjax("/letters/ajax/inbox/1"); message_table.fnDraw(); $(this).addClass("active").s ...