Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 3 of 3
  1. #1
    Junior Member BetaOP9's Avatar
    Join Date
    Aug 2003
    Posts
    19
    Member #
    2627
    Basically, i'm trying to use a (javascript) res check to load one of two css stylesheets. One sheet is tailored toward 1280 and up users, other is for 1152 and below. Right now using the if(parseInt(window.screen.width) > 1152), but am lacking the proper knowledge with javascript to call up the CSS link. I'll be adding this post to Javascript section as well, incase either side can help me. If you need more info in order to answer my question properly, let me know.

    Shawn

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Here's some code I used in a page back when NS4 was a standard browser to change stylesheets between IE/NS. Should work fine for your implementations, just change the browser for resolution.

    Code:
    	if (navigator.appName == "Netscape") {
    		document.write('<link rel=stylesheet href="gameNS.css" type="text/css">');
    	} else {
    		document.write('<link rel=stylesheet href="game.css" type="text/css">');
    	}
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site

  4. #3
    Junior Member BetaOP9's Avatar
    Join Date
    Aug 2003
    Posts
    19
    Member #
    2627
    Thanks brak, you got just what i was needing, the way the call up the css stylesheet. You rock


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:27 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com