Page 1 of 1

Responsive Design and WYSIWYG Images

Posted: Wed Aug 01, 2012 2:37 pm
by applejack
For responsive design having fixed width and height in the img tag is an issue so to remove the width and height you can use the code below.

Code: Select all

{content block='image' assign='myimage'}
{$myimage|regex_replace:"/[\"]+[\S\D]+/":''}

Re: Responsive Design and WYSIWYG Images

Posted: Wed Aug 01, 2012 8:46 pm
by uniqu3
Isn't it much easier to simply use max-width?
Removing width and height, is slowing down browser to actually render the page.

Code: Select all

img {
    max-width: 100%;
}
So image would never exceed width of parent element and scale as needed.

Re: Responsive Design and WYSIWYG Images

Posted: Wed Aug 01, 2012 9:21 pm
by applejack
max-width doesn't have full browser support.

Re: Responsive Design and WYSIWYG Images

Posted: Wed Aug 01, 2012 9:24 pm
by uniqu3
and media queries to which well are usually used for repsonsive layout.
Except you are talking about fluid layout.

Re: Responsive Design and WYSIWYG Images

Posted: Thu Aug 02, 2012 12:27 am
by applejack
True and as they say there are more ways than one to skin a cat which is especially true of front end coding these days...

I just came across this http://code.google.com/p/css3-mediaqueries-js/

width: auto\9; /* ie8 */

Nice work on the new admin theme by the way. Apart from I don't think the fixed width font for the textarea edit boxes work as it makes certain characters especially {} and () hard to distinguish. Or maybe it's been too long since my last eye test ;-)

Re: Responsive Design and WYSIWYG Images

Posted: Fri Aug 03, 2012 1:02 am
by carasmo
I use that rather than modernizer.

I make all "responsive" sites fluid because there's every size under the sun and your site should look good between the sizes. I just remove the image width and height and use max-width for inline and 100% for wide stuff. I test all the way back to ie 8 and it works fine.

Re: Responsive Design and WYSIWYG Images

Posted: Fri Aug 03, 2012 1:36 am
by applejack
Unfortunately for what I do just going back to IE 8 is not far enough. IE 7 still has quite a large usage and on one of my main clients sites so does IE 6.

Re: Responsive Design and WYSIWYG Images

Posted: Fri Aug 03, 2012 1:33 pm
by faglork
applejack wrote:Unfortunately for what I do just going back to IE 8 is not far enough. IE 7 still has quite a large usage and on one of my main clients sites so does IE 6.
http://code.google.com/p/ie7-js/

Have you tried that?

Cheers,
Alex

Re: Responsive Design and WYSIWYG Images

Posted: Fri Aug 03, 2012 1:40 pm
by applejack
No I haven't thanks.

I have used this before though http://css3pie.com

Re: Responsive Design and WYSIWYG Images

Posted: Fri Aug 03, 2012 4:28 pm
by carasmo
You can make it work in IE 7 and 6 just copy out the desktop css portion of your media queries to another css file for IE and attach them conditionally. However, you might find a script that works in ie 8 and higher that is responsive (like a slider) and it won't work in IE 6 and 7

With head.js http://headjs.com/

Just load that script for all but the old browser, and then serve up other js to ie or nothing to them and hide the html, it's less mess than Downlevel Reveal Conditional Comments.

http://msdn.microsoft.com/en-us/library ... dlrevealed