Fixed position misbehaviour in IE11
Asked Answered
U

4

9

I am experiencing elements position misbehaviour into my page, in IE(11) only; live link here. The logotext, the menu and the left sidebar text, remain in place doesn't move with the wrapper when the left slider is open (clicking on info+ button). I've read about position: fixed + transition in IE problems.

I've tried to apply position: expression(fixed); to the header but something went wrong and the wrapper receive a brake-movement at open/closing slider. (The sidebar didn't work with position: expression(fixed);)

Also I've tried to tweak the css modifying the element position values in static/ absolute but without succees.Tests are made in full screen, the theme is not for mobile screens.Any thoughts?

LE: I've found a possible solution that works with the slider in IE11:

.header {
  position: absolute;
}

.bar-side {
  position: absolute;
}

Will work with the slider but also will move on vertical scroll.If I ca fix that somehow, could be a solution.

Upkeep answered 19/6, 2015 at 16:30 Comment(3)
Have you checked your HTML markup for standards compliance? IE hates invalid HTML.Botello
if you reffer to Markup validation procedure, It looks like there are a few errors but not related to the above described problem. here is the result.Upkeep
thank you, may b; unfortunately, for me it's pretty difficult to tell because I'm not so good in coding stuff, I'm just trying to understand how things work ...Upkeep
C
3

For a quick solution add transform separately for IE, in IE only css hack.

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .header, #bar-left{
      left: 0;
      transition: all .5s;
  }
  .shiftnav-open .header, .shiftnav-open #bar-left{
     left:590px;
  }
}
Chifley answered 21/6, 2015 at 8:58 Comment(5)
That's it !!!! the header it's fixed in IE :) A++++ thank you very much.Is there any possibility to fix the sidebar too?Upkeep
The sidebar is part of the wrapper, it should translate with the wrapper like the header in IE ( if you'll open/close the slider in Chrome, Firefox is working :)Upkeep
the code is there but is not working ... can you please check too in IE?Upkeep
I really have no words to thank you. This is the right answer to fix the position: fixed misbehaviour in IE11, thank you, thank you, thank you ! I really appreciate it !Upkeep
I really don't want to be rude but, do you have any idea how can I solve the same issue with a fullscreen slider? I've opened here a new question : https://mcmap.net/q/1172750/-how-to-properly-apply-a-css-hack-for-ie11-transition-misbehaviourUpkeep
K
12

This may be way too late, but I had a similar issue with position:fixed and IE11, for a full page DIV (by specifying top: 0; bottom: 0; left: 0; right: 0;). Worked fine on Chrome, Edge, Firefox and Opera, but IE11 displayed the DIV at way under the full viewport size, and with rounded corners that seem to have inherited somehow from the parent.

Playing with the IE11 developer tools, I found an alternate option suggested as a parameter for position - "-ms-page". Using position: -ms-page sorted the issue; preceding this with position: fixed allowed the other browsers to carry on regardless.

Hope this helps others with a similar problem...

Kerman answered 20/2, 2017 at 17:48 Comment(1)
Exactly the same problem, works with your instruction.Nide
C
3

For a quick solution add transform separately for IE, in IE only css hack.

@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .header, #bar-left{
      left: 0;
      transition: all .5s;
  }
  .shiftnav-open .header, .shiftnav-open #bar-left{
     left:590px;
  }
}
Chifley answered 21/6, 2015 at 8:58 Comment(5)
That's it !!!! the header it's fixed in IE :) A++++ thank you very much.Is there any possibility to fix the sidebar too?Upkeep
The sidebar is part of the wrapper, it should translate with the wrapper like the header in IE ( if you'll open/close the slider in Chrome, Firefox is working :)Upkeep
the code is there but is not working ... can you please check too in IE?Upkeep
I really have no words to thank you. This is the right answer to fix the position: fixed misbehaviour in IE11, thank you, thank you, thank you ! I really appreciate it !Upkeep
I really don't want to be rude but, do you have any idea how can I solve the same issue with a fullscreen slider? I've opened here a new question : https://mcmap.net/q/1172750/-how-to-properly-apply-a-css-hack-for-ie11-transition-misbehaviourUpkeep
C
1

Move the header outside the .shiftnav-wrap and place it above it, and apply the translateX seperately for header movement.

.shiftnav-open header{
      transform: translateX(590px);
}

It is not good idea to depend on its movement relative to the outer div.

elements with fixed positioning are fixed relative to the viewport/browser window rather than the containing element - http://www.w3.org/wiki/CSS_absolute_and_fixed_positioning

Another solution, you can use the header as absolute positioned, inside the left div #shiftnav-info.

Chifley answered 20/6, 2015 at 4:53 Comment(5)
Thank you, I've tried to implement the first mehod. With the header inside the .shiftnav-wrap will work but without animation just start and end positions (not good). With header outside the .shiftnav-wrap doesn't work at all. I've tried the second method as well, positioning the header (as : absolute) inside the div #shiftnav-info using the IE console, the same result, didn't work unfortunately. Did you test these sugestions on IE console? How about the sidebar?Upkeep
For a quick solution, you can add an IE only CSS hack, and apply a transform seperately for IE.Chifley
It will be nice but how ? :) If I add -ms-transform: translateX( ... px ) to the fixed element, in IE will be always translated to that defined position. Can you please formulate a clear example after you have a test in IE console? Thanks,Upkeep
transition also added ?Chifley
Unfortunately I'm not so good in coding stuff that's why I am asking for clear answers. could you be so kind and please reformulate your main answer also with transition applied in order to check and validate your solution? :) I'm reffering to the header and the left sidebar.Upkeep
I
1
ADD this script in your page. IE fixed position scroll issue fixed.

<script>
if(navigator.userAgent.match(/Trident\/7\./)) {
  document.body.addEventListener("mousewheel", function() {
    event.preventDefault();
    var weelDelta = event.wheelDelta;
    var currentOffset = window.pageYOffset;
    window.scrollTo(0, currentOffset - weelDelta);
  });
}
</script>
Impropriety answered 22/7, 2019 at 11:37 Comment(1)
Could you please help the op learn and explain a bit more why this works.Sorry

© 2022 - 2024 — McMap. All rights reserved.