Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] headache: Div resize
- From: javascript@xxxxxxxxxx (Felix)
- Subject: [Javascript] headache: Div resize
- Date: Tue, 28 Aug 2001 18:29:37 +0200
C'est un message de format MIME en plusieurs parties.
------=_NextPart_000_014C_01C12FEF.64A74EA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
please look at this code for Netscape4+ :
When client resizes, the message scrolling window always fit the 1/2 of de
screen and is centered but text inside is troncated.
Have you got an idea
Thank you
Felix
------=_NextPart_000_014C_01C12FEF.64A74EA0
Content-Type: text/html;
name="essai.htm"
Content-Disposition: attachment;
filename="essai.htm"
Content-Transfer-Encoding: quoted-printable
<HTML>
<BODY onResize=3D"window.location.href =3D window.location.href;">
<SCRIPT LANGUAGE=3D"JavaScript">
var doc; //document (diff=E9rent selon Netscape ou MSIE)
var sty; //style (diff=E9rent selon Netscape ou MSIE)
var htm; //objet html (diff=E9rent selon Netscape ou MSIE)
var lg; //largeur du cadre
var ht; //hauteur du cadre
var h; //position bord haut
var g; //position bord gauche
function DonneTaille()
{
alert("test");
largeur_voulue=3DparseInt(cadre.dimension.largeur / 2);
eval(doc =
+'boite.'+doc+'defile'+sty+'.width=3D'+largeur_voulue);
eval(doc =
+'boite.'+doc+'defile'+sty+'.clip.width=3D'+largeur_voulue);
eval(doc +'boite'+sty+'.width=3D'+largeur_voulue);
eval(doc +'boite'+sty+'.clip.width=3D'+largeur_voulue);
eval(doc +'boite'+sty+'.height=3D'+ 70);
bord_gauche=3DparseInt((cadre.dimension.largeur - =
largeur_voulue)/2);//pour centrer ton calque
eval(doc +'boite'+sty+'.left=3D'+bord_gauche);
eval(doc +'boite.'+doc+'defile'+sty+'.left=3D'+0);
bord_superieur=3DparseInt(cadre.dimension.hauteur - 80);
eval(doc +'boite'+sty+'.height=3D70');
eval(doc +'boite'+sty+'.top=3D'+bord_superieur);
eval(doc +'boite'+sty+'.visibility=3D"visible"');=20
}
=20
function DIMENSIONS(lg,ht)
{
this.largeur =3D lg;
this.hauteur =3D ht;
}
function POSITIONS(h,g)
{
this.haut =3D h;
this.gauche =3D g;
}
function LE_CADRE(p_dimension,p_position)
{
this.dimension =3D p_dimension;
this.position =3D p_position;
}
doc =3D "document.";
sty =3D "";
htm =3D ".document";
lg =3D window.innerWidth - 15;
ht =3D window.innerHeight - 132;
h =3D window.screenX;
g =3D window.screenY;
dimension =3D new DIMENSIONS(lg,ht);
position =3D new POSITIONS(h,g);
cadre =3D new LE_CADRE(dimension,position);
function demarreScroll( spd, loop)=20
{
loop =3D true;
scrolltimer =3D null;
var page =3D eval(doc +'boite.'+doc+'defile'+sty);
var y_pos =3D parseInt(page.top);
if (loop =3D=3D true)=20
{
page.top =3D (y_pos - 1);
eval('quelle_hauteur=3D'+doc =
+'boite.'+doc+'defile'+sty+'.document.height');
eval('ou_est_top=3D'+ doc +'boite.'+doc+'defile'+sty+'.top');
ou_est_fin =3D parseInt(quelle_hauteur)+parseInt(ou_est_top);
if(ou_est_fin<=3D 0)=20
{
eval(doc +'boite.'+doc+'defile'+sty+'.top=3D'+50);
}
scrolltimer =3D setTimeout("demarreScroll(1)", 80);
}
}
function stopScroll()=20
{
loop =3D false;
clearTimeout(scrolltimer);
}
</script>
<CENTER>
<H2>Un scroller vertical</H2>
</CENTER>
<DIV ID=3D"boite" =
style=3D"position:absolute;visibility:visible;top:210px;left:10px;width:5=
00px;height:80px;z-index:1;clip:rect(0,600,70,0);">
=20
<DIV ID=3D"defile" =
style=3D"position:absolute;visibility:visible;top:5px;left:1px;width:100%=
;height:100%;z-index:2;">
Here is some texte to scroll<BR><BR>=20
exemple:<BR>
Lionel Jospin fait sa rentr=E9e et pour cela il a d=E9cid=E9 de =
s=92adresser directement aux Fran=E7ais pour tenter de r=E9pondre =E0 =
leurs doutes sur la Corse, la s=E9curit=E9 ou la situation =E9conomique =
et sociale. Le tout =E0 huit mois d=92un combat pr=E9sidentiel qui =
s=92annonce toujours aussi incertain. Contrairement aux ann=E9es =
pr=E9c=E9dentes, le Premier ministre a d=E9cid=E9 de ne pas attendre =
l=92universit=E9 du PS le 2 septembre =E0 La Rochelle pour faire sa =
rentr=E9e politique en s=92exprimant d=E8s mardi dans le journal de 20 =
heures de TF1, =E9galement retransmis sur tf1.fr. L=92exercice ne sera =
pas facile et le Premier ministre devra se montrer rassurant vis =E0 vis =
des Fran=E7ais.
</DIV>
</DIV>=20
<FORM>
<INPUT type=3D"button" value=3D"Acc=E9l=E8re" =
onclick=3D"javascript:demarreScroll('1','true');"><BR></INPUT>
<INPUT type=3D"button" value=3D"Ralentit" =
onclick=3D"javascript:stopScroll();"><BR></INPUT>
</FORM>
<SCRIPT LANGUAGE=3D"JavaScript">
DonneTaille();
demarreScroll('1','true');
</SCRIPT>
</BODY>
</HTML>
------=_NextPart_000_014C_01C12FEF.64A74EA0--
- Follow-Ups:
- [[Javascript] headache: Div resize (modified)
- From: Felix
- [[Javascript] headache: Div resize (modified)
- Prev by Date: [Javascript] DIV in a DIV
- Next by Date: [[Javascript] headache: Div resize (modified)
- Previous by thread: [Javascript] DIV in a DIV
- Next by thread: [[Javascript] headache: Div resize (modified)
- Index(es):