DHTML zoom in and out script
View Live Demo
Using zooom, you can zoom in and zoom out any iMage That IS specified in the code.
zoOom is very easy to customise. You can change the image, it's position. You can also set the maximum and minimum allowable widths. You can change the zoom speed. For customising, make changes in the 'configure' section of the script.
Begin by Pasting The Following Into The Head of Your Script:
Select All code
// Zooom 1.0
// (c) 2002 premshree pillai
// http://www.qiksearch.com
// premshree@hotmail.com
// LoAction of this Script:
// http://www.qiksearch.com/javascripts/zooom10.htm
// visit http://www.qiksearch.com/javascripts.htm for more free scripts
// configure zooom
/ / -------------------------------------------------------------------------------------------- -----------------
Var img_path = "zooom10.gif"; // the Image path |
Var Top_pos = 130; // Image position from top |
Var left_pos = 162; // Image position from left |
Var max_width = 900; // max allowable width |
VAR min_width = 10; // min allowable width |
VAR TIME_LENGTH = 1; // Zoom Delay in MilliseConds |
Var step = 2; // pixels by Which Image Should Zoomm |
/ / -------------------------------------------------------------------------------------------- -----------------
Document.write ('
IMG_ACT_HEIGHT = Z.HEight;
Var Original_Time = Time_Length;
Function zoom_out ()
{
IF (z.width == 0)
{
Z. Border = 0;
}
IF (z.width! = 0)
{
IF (z.Width> min_width)
{
z.width- = step;
Z.height = math.Round (z.width * ((img_act_height) / (img_act_width));
SetTimeout ("Zoom_out ()", Time_Length);
}
Else
{
Window.alert ('Width Less Than Minimum Width / N © qiksearch zooom.');
}
}
}
Function zoom_in ()
{
IF (z.width == 0)
{
Z. Border = 0;
}
IF (z.width! = 0)
{
IF (z.Width { z.width = step; Z.height = math.Round (z.width * ((img_act_height) / (img_act_width)); SetTimeout ("ZOOM_IN ()", TIME_LENGTH); } Else { Window.alert ('Maximum Width Exceeded / N © qiksearch zooom.'); } } } Function resume_zoom () { Time_Length = Original_Time; } Function pause_zoom () { Time_Length = 10000000000; } Function set_original () { Z.Width = IMG_ACT_WIDTH; Z.height = IMG_ACT_HEIGHT; } script> Now Here Are The Buttons to Control the Image: Select All Code tr> table>
Zooom in font > td> zooom out font > - td>