Hi folks,
I have a container whose width is fluid (depending on the size of the browser window), though it has a max-width of 950px. The container has a nested header h1 element which has some text as a strapline.
I want to somehow make this header text get smaller as the container gets narrower (using jQuery).
I think it'll work something like this:
- Get current container width
- Divide current container width by 950 to get a modifier number (e.g. will be something like 0.78)
- Get current CSS font size of h1 (convert from string to num?)
- Multiply this by the modifier number
- Pass the result back to the CSS font size of h1
I'd like it to work dynamically during the browser resize if possible.
Any ideas?
Cheers, James