-1

I am currently adapting a site to mobile design. The left navigation bar is separated from the rest of the page with an iFrame. I want to show and hide the left navigation bar with a button – this already works – but the iFrame remains in the middle of the screen and does not slide to the left. I have already tried margin: 0 auto; position: absolute; left:0px, but that does not work. I have tried everything with both the upper div and the iframe itself. On the right side the hierarchy is:

<div id="rechts">
  <div id="rechtsoben">
  <div id="rechtsunten">
     <div id="main_iframe" style="display:none"><iframe id="iframe_content" src=""></iframe></div>
function LinkesNavUmschalten() {
    var LinsmenuNav = document.getElementById("LinkeSeiteMobile");
    var LinsmenuNav2 = document.getElementById("rechts");
    LinsmenuNav.classList.toggle("menu-offen");
    LinsmenuNav2.classList.toggle("links-rucken");
    console.log(55);
}
.menu-offen {
   visibility: hidden;
}
.links-rucken {
    margin: 0 auto;
    position: absolute;
    left:0px
}
2
  • When and how is your function executed? Commented 7 hours ago
  • Also, there's no reference in the html to #LinkeSeiteMobile. Please edit your question to include a minimal reproducible example. Commented 7 hours ago

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.