Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2009
    Location
    South America
    Posts
    3
    Plugin Contributions
    0

    Default help implement scrip to load stylesheet depending on the user's screen resolution

    Hi, first time user of zen cart 1.3.8.

    I am getting ready to implent it, as my business home page, but first I want to change itīs looks to my taste.

    Obviosly Iīm not into web development, so Iīm a complete noob at coding but I am persistent and I apreciate a bit more detailed help.

    I want zen cart to automatically load a style sheet depending on users screen resolution, with the hopes to avoid the problem of graphics, logos and banner looking cut up or wrong, I tried the sliding door technique, but couldnīt get results I wanted because graphics design has to be a certain way.

    Iīve used the code below on a simple html test page and worked pretty good. Yet I dontīt know where or how to implement it in zen cart.

    <HEAD>

    <script type="text/javascript">
    <!-- Begin
    /* Created by: Bob Pearson :: http://www.pagecraft.on.ca */

    var winW = 0, winH = 0;

    if (parseInt(navigator.appVersion)>3) {
    if (navigator.appName=="Netscape") {
    winW = window.innerWidth-16;
    winH = window.innerHeight-16;
    }
    if (navigator.appName.indexOf("Microsoft")!=-1) {
    winW = document.body.offsetWidth;
    winH = document.body.offsetHeight;
    }
    }
    if (winW <= 1600) {
    document.write('<link rel="stylesheet" type="text/css" href="1600_stylesheet.css">');
    }
    if (winW <= 1280) {
    document.write('<link rel="stylesheet" type="text/css" href="1280_stylesheet.css">');
    }
    if (winW <= 1024) {
    document.write('<link rel="stylesheet" type="text/css" href="1024_stylesheet.css">');
    }
    if (winW <= 800) {
    document.write('<link rel="stylesheet" type="text/css" href="800_stylesheet.css">');
    }
    if (winW <= 640) {
    document.write('<link rel="stylesheet" type="text/css" href="640_stylesheet.css">');
    }
    // End -->
    </script>
    PS: Please excuse my english, Iīm a bit rusty !!!

  2. #2
    Join Date
    Mar 2009
    Location
    South America
    Posts
    3
    Plugin Contributions
    0

    Default Re: help implement scrip to load stylesheet depending on the user's screen resolution

    well no luck here , lets try magento see what happens

  3. #3
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,269
    Plugin Contributions
    3

    Default Re: help implement scrip to load stylesheet depending on the user's screen resolution

    There are posts on how to add extra javascript.

    http://www.zen-cart.com/forum/showthread.php?t=123555

    http://www.zen-cart.com/forum/showthread.php?t=118215

    And in the docs folder of your ZC software:

    read_me_jscript.html
    20 years a Zencart User

  4. #4
    Join Date
    Mar 2009
    Location
    South America
    Posts
    3
    Plugin Contributions
    0

    Default Re: help implement scrip to load stylesheet depending on the user's screen resolution

    well no luck here , lets try magento see what happens
    Thank you very much for the info I apreciate your response I really wanted continue using zencart.

    Yes Iīve read the docs folder read_me_jscript.html and my only doubt is where is the stylesheet first loaded ?, what file should I edit to comment out that part and let the script kickin, or should I just create jscript_css loader.js and add it to includes/templates/{template_directory}/jscript/

  5. #5
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: help implement scrip to load stylesheet depending on the user's screen resolution

    Just create a new file (the 2nd option you listed)
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  6. #6
    Join Date
    Mar 2008
    Location
    Cape Town & London (depends on the season)
    Posts
    2,975
    Plugin Contributions
    0

    Default Re: help implement scrip to load stylesheet depending on the user's screen resolution

    I think you'll find Magento more limiting - and perhaps more frustrating!

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: help implement scrip to load stylesheet depending on the user's screen resolution

    You would not want to disable or replace the existing stylesheet-loading mechanism, as it does many things automatically that you might want, including language style selection.

    You could have the width-specific stylesheets contain only rules that vary depending on the browser, leaving all of the common rules in the original stylesheet. This will simplify any future style edits - imagine changing colors for one element in five different stylesheets! Now imagine making twenty changes in each of five different stylesheets, and keeping all of them synchronized...

 

 

Similar Threads

  1. How to make the appearance of my store Screen Resolution independent?
    By mybiz9999 in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 5 Sep 2011, 03:48 PM
  2. need help with page layout/screen resolution
    By Kathi_S in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 26 Jul 2011, 02:43 PM
  3. Screen Resolution & the Banner
    By ScriptJunkie in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 22 Sep 2008, 04:02 AM
  4. Need help with page size and screen resolution
    By kinget in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 12 Aug 2008, 07:52 PM
  5. Template depending on screen resolution
    By mat123slade in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Oct 2006, 02:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg