Previous Message
Next Message

using javascript to move DOM elements up front?

Sent by martin f krafft on 21 March 2008 17:05


--===============0562598610==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT"
Content-Disposition: inline


--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Dear list,

I am designing a new content-heavy page and I would very much like
for the content to start right away in the source code, while stuff
like the header and the sidebar should follow afterwards.

I can easily achieve what I want with the sidebar, but in order to
place the header after the content in the source, and yet make it
appear at the top of the rendered page, it seems I have to use
position:absolute. This causes the header to occupy no space in the
document, and hence I have to hard-code a margin-top on the content
element, to make sure it starts after the header. This is
problematic for various reasons, mainly due to the header's height
being dynamic.

I played around with with JavaScript a bit and this gave me the idea
that I could simply render the header at the end of the document,
and then shift the node to the proper location in the DOM tree on
load.

I wonder if anyone of you has any experience with this, or if
there's a better, pure-CSS approach to what I am trying to do.

Cheers,

--=20
martin | http://madduck.net/ | http://two.sentenc.es/
=20
"i like .net for the same reason i like gentoo. it keeps all the
 people with no clue from writing c code, which is much harder for me
 to identify and eliminate from my systems. in the same way that
 gentoo gives those people a place to be that isn't in debian"
                                                    -- andrew suffield
=20
spamtraps: [EMAIL-REMOVED]

--X1bOJ3K7DJ5YkBrT
Content-Type: application/pgp-signature; name="digital_signature_gpg.asc"
Content-Description: Digital signature (see http://martin-krafft.net/gpg/)
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH47vHIgvIgzMMSnURAqnpAKCgZeI9eeilKBKyIPLAC3oBB3vNmwCeLVsn
Rz6mzgNeQp2hHuznL/gF7YI=
=Fxbs
-----END PGP SIGNATURE-----

--X1bOJ3K7DJ5YkBrT--

--===============0562598610==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
--===============0562598610==--
Previous Message
Next Message

Message thread: