HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 10th, 2009, 10:56 AM
spadez spadez is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 141 spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 55 sec
Reputation Power: 10
How did bing do this? Image Column

Hi.

Ive been looking at the bing image search page and it is clever how when you resize the page, to for instance make it less wide, the image columns move closer together, untill one of the columns is removed and they again stretch to fill the space.

Can someone tell me how you can achieve this flexible column grid that they have made? Can it be done purely with CSS or is some javascript needed?

Thanks!

Reply With Quote
  #2  
Old September 10th, 2009, 01:53 PM
Ebot's Avatar
Ebot Ebot is offline
Meatball Surgeon
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jul 2004
Location: Elbow deep in code
Posts: 1,965 Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)Ebot User rank is General 1st Grade (Above 100000 Reputation Level)  Folding Points: 83309 Folding Title: Advanced FolderFolding Points: 83309 Folding Title: Advanced FolderFolding Points: 83309 Folding Title: Advanced FolderFolding Points: 83309 Folding Title: Advanced FolderFolding Points: 83309 Folding Title: Advanced Folder
Time spent in forums: 2 Weeks 2 Days 13 h 53 m 52 sec
Reputation Power: 1070
didn't look at exactly how they did it, but you can set a width of a column to a percentage. so....


Code:
<td width="25%">my image</td>
__________________
Three gigs for the secretaries fair
Seven gigs for the system source
Nine gigs for the coders in smoky lairs
One disk to rule them all, one disk to bind them
One disk to hold the files, and in the darkness grind'em
---------------------------------------------------
It is by caffeine alone that I set my mind in motion.
It is by the beans of Java, that my thoughts acquire speed.
The hand acquire shakes; the shakes become a warning.
It is by caffeine alone that I set my mind in motion.

Reply With Quote
  #3  
Old September 10th, 2009, 02:10 PM
spadez spadez is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 141 spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 55 sec
Reputation Power: 10
Hi.

In that way, setting the each column at 25% means no matter how wide the page, there will only be 4 columns. Bings is more advanced, if the page is very wide there could be 18 columns with relative spacing inbetween the columns. How might this be done?

Reply With Quote
  #4  
Old September 10th, 2009, 02:50 PM
medialint's Avatar
medialint medialint is offline
Type Cast Exception
Click here for more information.
 
Join Date: Apr 2004
Location: Oakland, CA
Posts: 13,970 medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)medialint User rank is General 70th Grade (Above 100000 Reputation Level)  Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1Folding Points: 319635 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 3 Weeks 2 Days 14 h 7 m 58 sec
Reputation Power: 5623
Facebook
Quote:
In that way, setting the each column at 25% means no matter how wide the page, there will only be 4 columns. Bings is more advanced, if the page is very wide there could be 18 columns with relative spacing inbetween the columns. How might this be done?


1/18 = .05555555555555555555555555555555555555

So set your column widths at around 5.56% ;-)

Bing uses a lot of css you can set the width property to a percentage in css as well. Also you can set the padding to give you that relative spacing in between ...
__________________
medialint.com


"Beware of the man who works hard to learn something, learns it, and finds himself no wiser than before. He is full of murderous resentment of people who are ignorant without having come by their ignorance the hard way."
- Vonnegut - Cat's Cradle, 1963

Reply With Quote
  #5  
Old September 11th, 2009, 03:21 AM
spadez spadez is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 141 spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 55 sec
Reputation Power: 10
But bing varies the number of columns based on the width of the screen, it isn't always at 4 or 8. How do they do that?

Reply With Quote
  #6  
Old September 11th, 2009, 05:03 AM
spadez spadez is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 141 spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 55 sec
Reputation Power: 10
I guess its something a bit like this, as the page dimensins change, so does the layout:

http://www.xs4all.nl/~sbpoley/webmatters/layout6.html

Reply With Quote
  #7  
Old September 13th, 2009, 11:08 AM
spadez spadez is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 141 spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 55 sec
Reputation Power: 10
Update: www.deviantart.com also do this. When you resize the width of the page, the number of columns of images changes. Can someone please tell me how this is done? Is it simple css or does it require javascript?

Reply With Quote
  #8  
Old September 14th, 2009, 04:14 AM
spadez spadez is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 141 spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level)spadez User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Day 13 h 57 m 55 sec
Reputation Power: 10
Thats good news - are you able to tell me how it might be done with css.

Reply With Quote
  #9  
Old October 16th, 2009, 02:39 AM
Catacaustic's Avatar
Catacaustic Catacaustic is offline
Code Monkey V. 0.9
Dev Shed Novice (500 - 999 posts)
 
Join Date: Mar 2005
Location: A Land Down Under
Posts: 602 Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level)Catacaustic User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 14 h 43 m 2 sec
Reputation Power: 208
When you look at the CSS it's not that hard to figure out.

There's two settings that you need to look at. You'd set these up in CSS like
Code:
.img_container {
    width: 170px;
    display: inline-block;
}

Then you need your HTML code like:
Code:
<div>
  <div class='img_container'><img src='' /></div>
</div>

Then you add as many divs with the class img_container as you need to. This makes all of the boxes that contain the images 170px wide, and they will flow to the next line when the page is not wide enough.

Of course, they have a LOT more CSS and JS going on in the background, so like most other things... it won't be as easy as that to make it work just the same as theirs does. But, hopefully this is a step in the right direction.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > How did bing do this? Image Column


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek