Subscribe: Comments on: If I Told You You Had a Beautiful Figure…
http://ajaxian.com/archives/if-i-told-you-you-had-a-beautiful-figure/feed/
Added By: Feedage Forager Feedage Grade B rated
Language: English
Tags:
client  code code  code  content  css  dimensions  fix css  fix  images  layout  libraries  outer  part  prototype  resizing  solution 
Rate this Feed
Rate this feedRate this feedRate this feedRate this feedRate this feed
Rate this feed 1 starRate this feed 2 starRate this feed 3 starRate this feed 4 starRate this feed 5 star

Comments (0)

Feed Details and Statistics Feed Statistics
Preview: Comments on: If I Told You You Had a Beautiful Figure…

Comments on: If I Told You You Had a Beautiful Figure…



Cleaning up the web with Ajax



Last Build Date: Thu, 14 Mar 2013 12:48:38 +0000

 



By: Joe

Tue, 25 Sep 2007 18:23:40 +0000

I agree with everyone. There's many ways to skin a cat but this just seems to be breaking out a chainsaw when other options are far better.



By: Charles

Tue, 25 Sep 2007 17:41:48 +0000

Jake, Andy I got flamed the other day for suggesting the same things: 1. How, as a layout designer, does one not have control over the layout and 2. Just because something seems hard in CSS does not mean it can't be done. Too often JS is used where designers can't see a solution in grid design or floats. The worst part is that JS is not very good at resizing the flow of content -- for instance, firing up to 1000s of times on a window resize. The strange part to me is that this is being done client-side, not in the CMS. If you know what the target dimensions are for images, you could have a backend utility read the dimensions on post, or send the image dimensions from the client, and have the change permanently committed to the HTML. That way there's no weird resizing on page load. Also, then there's no need for prototype (or other libraries). I repeat that I think this is a bad example for n00bs, encouraging framework dependency over faster, more proper JS or CSS . It's great now that jQuery, Prototype, and YUI have Positioning/Dimensions libraries, but relying on them for basic layout is a bad path to take.



By: Andy

Tue, 25 Sep 2007 13:33:22 +0000

Another solution is to work closer with "those who fill in the content" so they understand the design goals (and the designer understands the content goals) to avoid this kind of thing all together. Also, if the "images pixelate horribly when resized", why would the browser be any better at this?



By: jake

Tue, 25 Sep 2007 13:08:28 +0000

I hate to say this but ... this is an example of what not to do with JavaScript. JavaScript is meant to add interaction to a webpage, not fix an html/css issue. The only exception might be using JS to fix a browser specific css bug but still it is usually better to fix you're css bugs within your stylesheets. This example could easily be done using a table. The 'image with caption' can be wrapped with which will collapse the outer container. Another easy solution is just include the image width, which we all know to do from HTML 101, and then you could also set the outer div width.