Results 1 to 5 of 5
  1. #1

    Java Code onmouseover different size??

    How do i resize the image onmouseover? The image is small and I want to the image to increase size when you place the mouse over the image. Is it possible? here is the code I am currently using but I dont know where to place the new size info.


    <a href="/images/viewsonic1.jpg" height="96" width="154" border="1" target="viewsonic"
    onmouseover="maintool.src='/images/viewsonic3.jpg'; return true;"
    onmouseout="maintool.src='/images/viewsonic3.jpg'; return true;">
    <img src="/images/viewsonic3.jpg" height="96" width="154" border="0" name="maintool" id="maintool" alt="maintool"/>


    This is my first post here am new, sorry if I posted it in the wrong board.

  2. #2
    Join Date
    Feb 2002
    Location
    Vestal, NY
    Posts
    1,378

    Re: Java Code onmouseover different size??

    Originally posted by mugzy0130
    How do i resize the image onmouseover? The image is small and I want to the image to increase size when you place the mouse over the image. Is it possible? here is the code I am currently using but I dont know where to place the new size info.


    <a href="/images/viewsonic1.jpg" height="96" width="154" border="1" target="viewsonic"
    onmouseover="maintool.src='/images/viewsonic3.jpg'; return true;"
    onmouseout="maintool.src='/images/viewsonic3.jpg'; return true;">
    <img src="/images/viewsonic3.jpg" height="96" width="154" border="0" name="maintool" id="maintool" alt="maintool"/>


    This is my first post here am new, sorry if I posted it in the wrong board.
    Try:


    onmouseover="maintool.height=96*2; maintool.width=154*2;" onmouseout="maintool.height=96; maintool.width=154;"

    You can replace the "*2"s with *1.5 or *3 (or replace the whole thing with a pixel size instead) for bigger or smaller images.
    H4Y Technologies LLC Check out our new website!
    "Smarter, Cheaper, Faster" - SMB, Reseller, VDS, Dedicated, Colo hosting done right.

    ZERO PACKETLOSS, ZERO DOWNTIME Dedicated and Colo - USA: IA, CA, NC, OR, NV
    **http://h4y.us**
    Voice: (866)435-5642. *** Email: askus at host4yourself d0t com

  3. #3
    Although note that some older browsers will not "reflow" the page, meaning whatever size the original image was, that's how big any replacements will be...

  4. #4
    Join Date
    Sep 2002
    Location
    Illinois
    Posts
    2,304
    mugzy0130

    Java and JavaScript are different languages
    How's my programming? Call 1-800-DEV-NULL

  5. #5
    thanks John[H4Y] worked great!

Posting Permissions

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