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)

WebmasterWorld Senior Member 5+ Year Member

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 Jul 18, 2012 (gmt 0)

5+ Year Member

After you detect browser resolution in javascript you can rewrite the DIVs using the innerHTML command


1:00 pm on Jul 18, 2012 (gmt 0)

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

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

Featured Threads

Hot Threads This Week

Hot Threads This Month