Reply to Re: Making a div auto space...

Your name:

Reply:


Posted by Neredbojias on 06/01/06 00:01

To further the education of mankind, Nony Buz <noya@dwtty.com>
vouchsafed:

>>> But if there
>>> is enought room, I want there to be a 40px margin between the
>>> 760x420 and the top of the browser. How do I do that without
>>> server side code?
>>
>> Javascript.
>>
>> if (screen.width>800) document.getElementById
>> ('workdiv').style.marginTop='40px';
>
> I tried it and it does not seem to work in either Firefox or IE.
> here is my code:

> </style>
> </head>
> <script type=text/javascript>
> if (screen.width>800)
> document.getElementById('main').style.marginTop='40px';
> </script>
> <body>
> <div id="main">
> </div>
> </body>
> </html>

Include the js _within_ the <body> container after the "main" div.

Javascript should always be in either the <head> or <body> section.

--
Neredbojias
Infinity has its limits.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация