[OSM-dev] CSS gurus required
James R. Glasgow
james at jrglasgow.com
Fri Nov 24 14:27:11 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Christopher Schmidt wrote:
> On Thu, Nov 23, 2006 at 12:43:16PM +0000, SteveC wrote:
>> Can anyone figure out how to make this resizing work properly?
>>
>> http://www.openstreetmap.org/index-new.html
>>
>> Eg make it consitantly hug the border of the browser window.
>
> I've not yet found a pure-CSS way to do this in all browsers. In order
> to do this, I've used:
>Unfortunately there is no way to do anything in CSS yet that is
available in all browsers, not all browsers are CSS compliant. IE is
the worst
>
>
> function adjustWidth(px,element) {
> if (window.innerWidth) {
> element.style.width=Math.max(window.innerWidth-px,100)+"px";
> } else if (document.documentElement.clientWidth) {
>
element.style.width=Math.max(document.documentElement.clientWidth-px,100)+"px";
> } else if (document.body.clientWidth) {
> element.style.width=Math.max(document.body.clientWidth-px,100)+"px";
> }
> }
>
> If you run "adjustWidth(200, $('map'))", it should do something close to
> what you want.
>
> Regards,
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFZwE/AnmjKQiGQLsRAqcrAJ9hAf1xPXDqTsYbUsEfZrc8aHH/OgCfXITm
NJNVjJJEjWODosTE5mIUKkQ=
=C7RO
-----END PGP SIGNATURE-----
More information about the dev
mailing list