Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    29
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Limiting sizes in div's

    http://www.dynamicdrive.com/dynamici...thumbnail2.htm

    I intend on using this gallery viewer on my site.

    Is it possible to make it so that image that is displayed in the div is limited to certain dimensions.. say 100 by 100px. If an image that is displayed is above the limit, the excess is simply just out of view..

    I dunno how this would be possible maybe by a use of some sort of mask, i normally code inflash im not sure if taht is possible with divs in html. Or maybe you can limit the size in the js file, if your allowed to.

    Any help will be much appreciated thank you

    (If your wondering why dont I just use images that are less than 100x100px, it is because, other people will be able to save their imageshack or photobucket links ot the site and using perl be able to display it in the gallery, the size limit needs to be inhibited somehow)

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    679
    Thanks
    0
    Thanked 16 Times in 15 Posts
    In the javascript you could add a width of 100 to the image tag, though it is generally not a good way to resize an image
    Code:
    var imageHTML='<img src="'+imagepath+'" width="100" style="border-width: 0" />'


  •  

    Posting Permissions

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