Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
Thread: can js tell css what to do?
12-21-2010, 03:29 PM #1
can js tell css what to do?
Anyway, here's the thing: I made a nice little navigation bar out of divs that looks fine on my screen (1280 x 720) but my friend told me that it runs off-screen on his screen (1024 x 600) and then my other friend said that on his screen (1920 x 1080) it barely reaches halfway across.
Obviously I'd like it to look more or less the same on most computers.
So after looking around for a bit, I found this page which talks about a js code that basically measures the screen space.
Now, being that the only way I can find to make the navigation bar "fit" in different screen resolutions is to change the font size of the text inside the divs, I figured that something like this:
here's the page I'm working on
and the js file I'm using is here
So, to my question (finally): am I writing the code wrong, or is it not possible to control text size in this way?
Or is there a better way to go about this?
thanks for any suggestions.
12-21-2010, 04:25 PM #2
- Join Date
- Aug 2010
- High Point, NC
- Thanked 363 Times in 360 Posts
12-21-2010, 05:05 PM #3
I'm confused, too. Especially since I asked basically this question here a couple of days ago and didn't hear about any of this stuff.
But the way I understand it, fluid websites are fine for resizing divs that have space to stretch and shrink, but the divs like I have that exactly fit the text that holds them can't shrink because they will always only be as small as the text inside.
Hence the need for text resizing. Or am I completely confused about this?
Anyway. Over on the js forum they're suggesting one seemingly-complicated method or else Media Queries which seems to work nicely, although only on modern browsers