Click to See Complete Forum and Search --> : Zoom in/out


cacalex
05-29-2003, 10:49 AM
hi everyone !
I'm trying to make this little script working...
It's an zooming script, for an page with several images, allowing the user to zoom in the page, making images bigger or smaller...

The probleme is that when the user zoom in, and then zoom out, it takes two click on the zoom out buton before it zomm out...

Help !!!!!

<HTML>
<HEAD>
<TITLE>Zoom Test...</TITLE>
<script language="javascript">

var SW

function Retab()
{
document.body.style.zoom = 1;
SW=1
}

function U()
{
alert(SW)
document.body.style.zoom = (SW+0.2);
SW=SW+1
}

function D()
{
alert(SW)
document.body.style.zoom = (SW-0.2);
SW=SW-1
}

</script>
</HEAD>
<BODY onload="Retab();">
<FORM name="Fm">
<CENTER>
<BR>
<Button onclick="U()">UP</Button>
<Button onclick="D()">Down</Button>
<BR><BR>
<Button onclick="alert(SW)">Combien</Button>
<Button onclick="Retab()">R&eacute;tablir....</Button>
<BR>


</CENTER>
</FORM>

</BODY>
</HTML>:confused: :confused:

requestcode
05-29-2003, 11:26 AM
Here is a link to a script that uses the Zoom in/out feature.
http://javascriptkit.com/script/script2/imagezoom.shtml

Perhaps it will help.

Jona
05-29-2003, 11:28 AM
<HTML>
<HEAD>
<TITLE>Zoom Test...</TITLE>
<script language="javascript">
var SW = 1;
function Retab(){
document.body.style.zoom = 1;
SW++;
}

function U(){
SW++;
document.body.style.zoom = SW;
alert(SW);
}

function D(){
SW--;
document.body.style.zoom = SW;
alert(SW);
}

</script>
</HEAD>
<BODY onload="Retab();">
<FORM name="Fm">
<CENTER>
<BR>
<Button onclick="U()">UP</Button>
<Button onclick="D()">Down</Button>
<BR><BR>
<Button onclick="alert(SW)">Combien</Button>
<Button onclick="Retab()">Rétablir....</Button>
<BR>
</CENTER>
</FORM>
</BODY>
</HTML>

cacalex
05-30-2003, 08:11 AM
Okay thanks !!!
that was helpful !

Jona
05-30-2003, 12:46 PM
You're welcome. ;)

Jona