Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

How to read resolution and automatic set DIV element?

2:30 pm on Jul 17, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 25, 2006
posts: 1019
votes: 0

I have issue that there are icons 16x16px and floated right. When there is very high resolution I like to have changed icons to 32x32px.

How to set this modified DIV with javascript and/or PHP or there are some nice solutions.Need help.
10:06 am on July 18, 2012 (gmt 0)

Full Member

5+ Year Member

joined:Oct 22, 2010
votes: 0

After you detect browser resolution in javascript you can rewrite the DIVs using the innerHTML command
1:00 pm on July 18, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 17, 2005
posts: 4988
votes: 12

Don't use JavaScript for this, use CSS media queries. Here's an article that describes how: