Javascript for CSS style modification inside Google Chrome browser -


I am facing a strange problem that is developing web applications, as much as possible with the most popular browsers :

I have found an HTML code that I want to click on a button from its original position inside the page to move to another position.

Here is the HTML code:

& lt; Div id = "content" & gt; Text content ... & lt; / Div & gt;

Related CSS:

div # content {padding: 15px 15px 15px 215px; }

and javascipt to move the block when clicking on a button:

document.getElementById ('content'). Style.padding = "15px 15px 15px 15px";

=> It works fine in Firefox, IE and Opera (basically, it expands a content block, basically fills the page half of the page on the full page )

=> In Chrome, the javascript code does not extend the block width but transfers it with a fixed width of 200px (but if I fix the padding modifications at once to the hard code Lets ...)

Umi to me If there is a solution for anyone then thanks in advance .. If

If you swap padding for margins It does the same thing in both Firefox and Chrome (on my PC too):

  div # content {padding: 0; Margin: 15px 15px 15px 15px; Background: #fff; }  

and then:

  Hide the function sidebar () {document.getElementById ('content') .style.margin = "15px 15px 15px 15px "; Document.getElementById ('out') .style.display = "none"; Document.getElementById ('in') .style.display = "block"; } ShowShadowbar () {document.getElementById ('Content'). Style.margin = "15px 15px 15px 215px"; Document.getElementById ('outside') .style.display = "block"; Document.getElementById ('in') .style.display = "none"; }  

You may have to wander with some of the rest of your genre to see it.

I think what Chrome is doing is proper (not that I have reviewed the glasses to check), increasing padding should naturally make the block wide.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -