0

Hello I am fairly new to all of this. I have built my layout using divs that have their dimensions set as percentages so that they scale to the correct size when the browser window is resized. Some of the divs form buttons in a navigation bar (with text on each). But when I resize the browser window the text stays large. Is there any way to solve this?

Kirsty Ku
  • 1
  • 1

1 Answers1

0

Use this:

iStandardWidth = 960;
topofthetopdiv.style.zoom = parseInt(window.innerWidth/iStandardWidth, 10);
Somnath Muluk
  • 55,015
  • 38
  • 216
  • 226
Sebas
  • 21,192
  • 9
  • 55
  • 109
  • errm. thankyou for the quick response :) but where abouts to i put this, and which bits do I change? thanks – Kirsty Ku May 20 '12 at 01:33
  • you have to decide and setup your standard size first: the size of browser that you want to be the size when everything shows 100%. then change "topofthediv" by your top parent div javascript object name... – Sebas May 20 '12 at 01:43
  • ok well i changed "topofthediv" to the parent div's class name.. Sorry to be such a noob but do I enclose this in – Kirsty Ku May 20 '12 at 01:50
  • yes this code is javascript, but it should be your window.onresize event so it actually takes in consideration updated browser size. there's something else, zoom is css3, maybe your browser doesn't support it. – Sebas May 20 '12 at 01:54
  • So I have to create a style class called .zoom? I really have no knowledge of javascript. So would it be like this? – Kirsty Ku May 20 '12 at 02:07
  • no, zoom is a css property already, not a class. For the rest I don't use jquery so i can't really help your syntax... sorry – Sebas May 20 '12 at 02:25