www.webdeveloper.com
Results 1 to 2 of 2

Thread: shrink table to fit new image size

Hybrid View

  1. #1
    Join Date
    Dec 2011
    Posts
    1

    shrink table to fit new image size

    Hi,

    I have a table on my site which contains a lot of images (all equal size). I have a zoom button that (should) let the user zoom in or out on the table a bit. As the size of the images is the main factor deciding the table size, I mena to achieve this by making the images larger or smaller.

    This works fine. however, the width of the table cells doesn't change and still corresponds to the original image size, so I just end up with small pictures inside big table cells. Does anyone know how to make width of the cells shrink with the pictures?

    javascript:
    Code:
    function zoom(sz /* either small.medium or large */) {
    	pcs = $("container").getElementsByTagName("img");
    	for(var i=0;i<pcs.length;i++){
    		pcs[i].className = sz;	
    	}
    }
    css:
    Code:
    #container img.large{
    	width:100%
    }
    #container img.medium{
    	width:80%
    }
    #container img.small{
    	width:60%
    }

  2. #2
    Join Date
    Dec 2011
    Location
    Lebanon
    Posts
    3
    I greatly appreciate every one of the informative read on wd.iworld.com. I most certainly will spread the phrase about your site with people. Cheers.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles