#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    372
    Rep Power
    15

    Slide show script - question about "width", "height" variables


    Will omitting the Width="" and the Height="" variables cause any problems with a slideshow scipt?

    The first script below uses the same set of images. Since the image width and height variables are defined the first script will stretch (or shrink) or otherwise distort all of the images.

    The second script at the bottom uses two sets of images - one large set for the "main" image and a small set for the thumbnails. Also, the second script below does not have any width or height variables defined. For that reason, the images display with their actual widths and heights (i.e. no distortion).

    My questions are: Will omitting the width and height variables in the second script below cause any problems in the functionality of the script? If not, why would the width and height variables be needed in the first place?
    PHP Code:
    // This script distorts the images to conform to the width and height variables.
    <img src="a1.jpg" name="main" id="main" border="0" width="600" height="600">

    <
    img src="a1.jpg" onMouseOver="document.main.src='a2.jpg';" width="100" height="100">
    <
    img src="a2.jpg" onMouseOver="document.main.src='a3.jpg';" width="100" height="100">
    <
    img src="a3.jpg" onMouseOver="document.main.src='a4.jpg';" width="100" height="100">
    <
    img src="a4.jpg" onMouseOver="document.main.src='a5.jpg';" width="100" height="100">
    <
    img src="a5.jpg" onMouseOver="document.main.src='a5.jpg';" width="100" height="100">
    <
    img src="a6.jpg" onMouseOver="document.main.src='a6.jpg';" width="100" height="100">


    // No width="" and height="" variables. This one does not distort the images.
    <img src="a1.jpg" name="main" id="main" border="0">

    <
    img src="Small_a1.jpg" onMouseOver="document.main.src='a1.jpg';">
    <
    img src="Small_a2.jpg" onMouseOver="document.main.src='a2.jpg';">
    <
    img src="Small_a3.jpg" onMouseOver="document.main.src='a3.jpg';">
    <
    img src="Small_a4.jpg" onMouseOver="document.main.src='a4.jpg';">
    <
    img src="Small_a5.jpg" onMouseOver="document.main.src='a5.jpg';">
    <
    img src="Small_a6.jpg" onMouseOver="document.main.src='a6.jpg';"
    Thanks
  2. #2
  3. mod_dev_shed
    Devshed Supreme Being (6500+ posts)

    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    14,800
    Rep Power
    1103
    There should be no change in functionality, only appearance. If you want to limit either the width or height, you can add just that and the image will scale instead of distort.
    # Jeremy

    Explain your problem instead of asking how to do what you decided was the solution.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2002
    Posts
    372
    Rep Power
    15
    jharnois,

    Thank you for responding to my question.

    I appreciate the help.

IMN logo majestic logo threadwatch logo seochat tools logo