SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Aug 2003
    Location
    Vancouver, WA
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Convert this small PHP script into JavaScript

    Hello,

    I'm having troubles converting this PHP script into JavaScript

    function ResizeImage($image ,$width ,$height)
    {
    //image resizer by myscripting
    //get the size of the original
    $size = GetImageSize($image);
    //divide the width / height percentage by 100
    $new_width = 100 / $width;
    $new_height = 100 / $height;
    //store the resized dimensions in a variable
    $sizeh = $size[1]/ $new_height;
    $sizew= $size[0]/ $new_width;
    //display the new resized image
    $new_image = "<img src = \"$image\" height=\"$sizeh\" width =\"$sizew\">";
    echo $new_image;
    }

    What im trying to do is beable to resize an image in a DHTML layer onMouseover using the above function ResizeImage("1.gif",50,50);

    Please help.

    Thanks,
    -Flint
    Last edited by DDesign; Aug 9, 2003 at 23:49.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •