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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:24:52+00:00 2026-06-08T00:24:52+00:00

In my XLST, we use vanilla javascript to manipulate some divs that are in

  • 0

In my XLST, we use “vanilla” javascript to manipulate some divs that are in our reports. One of them goes above everything else in the center of the screen, and I was calling it like so when the page loads:

var overlayObj = document.getElementById('theoverlay');
overlayObj.style.left = Math.max(0, ((window.innerWidth - overlayObj.offsetWidth) / 2) + window.scrollX);
var padding = 50;
overlayObj.style.top = window.scrollY + padding;
overlayObj.style.bottom = -window.scrollY + padding;

This is also called when the page is resized + scrolled, and it works fine, however I noticed that there was no doctype in our XSLT and this was causing quirks mode in IE which just about broke everything. So I added the HTML5 doctype and now the code above doesn’t do anything. I’ve put in alerts to fire out the values of overlayObj.style.left and when there is NO doctype in the file I get the exact div sizes back, but when there is a doctype I get the value auto.

Does anyone know why this might be happening? And how to make it give me the values?

When getting the data I was using:

var computedStyle = window.getComputedStyle(overlayObj, null);
alert("left value: " + computedStyle.getPropertyValue("left"));

If I try to return overlayObj.style.top when there is a doctype, I get no response. Again, without the doctype there is no problems and the value is returned.

  • 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-06-08T00:24:53+00:00Added an answer on June 8, 2026 at 12:24 am

    Well with quirks mode the browser does try to make sense of your broken CSS but in standards mode you need to make sure you assign a proper CSS value to top or left and that consists of a number and a unit e.g. foo.style.left = 200 + 'px';. So make sure you provide that unit and the assignment should work.

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

Sidebar

Related Questions

I have a strictly browser based JavaScript and xlst application. It's normally used on
Thank you one and all. I have an PHP MVC framework that uses XSLT
I have an XLST file that is supposed to parse an XML file and
I'm trying to use an array in XLST in my ServiceMix module. here is
Following XLST code works fine :- <?xml version=1.0?> <xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform version=1.0> <xsl:template match=/> <xsl:for-each
I have the following in an XLST document <xsl:stylesheet version=2.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform xmlns:fo=http://www.w3.org/1999/XSL/Format xmlns:str=http://xsltsl.org/string xmlns:dt=http://xsltsl.org/date-time
I just learned about XLST on stackoverflow today (I love how in computers you
I'm trying to apply an xlst transformation using the following file. This is very
I'm reasonably new to xlst and am confused as to whether there is any
I've been swapping out connectionstrings wholesale wtih xlst for a while thusly <xsl:template match=/configuration/connectionStrings/add[@name='SybaseDB']/@connectionString

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.