Jump to content

Using Javascript to alter resolution


nodster

Recommended Posts

Can it be done.

 

My website is best viewed at a high resolution, however i've had some comments that on a smaller screen/resolution i lose some of the page.

 

now i could redo the site for the lower resolution/screen size but this would take to long.

 

So does anyone know of a way to do this in javascript?  If indeed it is possible.

 

??? ???

Link to comment
Share on other sites

The best you can do is prompt an alert message to users that using low resolution.

 

Second- or third-best, I'd say.  Designing for any resolution (or percentage of window) is the real best solution.

Link to comment
Share on other sites

I've been thinking about this,

 

could javascript be used to determine the size of window available and then use that answer to load a certain css file, ie so that i could use a fixed background image for each size of window or is that too difficult a way to go about it?

 

Ta

???

Link to comment
Share on other sites

Ok modifying it slightly (as i don't really understand the switch function)

 

Could somebody have a look at this code and see where i've gone wrong  :o  ???

 

<script language="javascript" type="text/javascript">

<!--

function checkCss() {

var cssNode = document.createElement('link');

cssNode.type = 'text/css';

cssNode.rel = 'stylesheet';

cssNode.media = 'screen';

cssNode.title = 'dynamicLoadedSheet';

document.getElementsByTagName("head")[0].appendChild(cssNode);

 

if

(document.body.clientWidth < 1000);

cssNode.href = 'http://website/small.css';

}else

 

(document.body.clientWidth < 1300);

cssNode.href = 'http://website/medium.css';

}

</script>

 

I have (for the time being) placed this into the <head> of my page but will be making it an external sheet was it works.

 

TIA

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.