Announcement

Collapse
No announcement yet.

How to detect screen size?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Re: How to detect screen size?

    I've got a hand-crafted responsive store that I need to be able to detect the browser size in order to display a javascript that I have to use two versions of based on the window size (the provider of the script has a responsive version in the works). The script loads an iframe and from that point on, I have no control. Within the script itself I can change the number of columns display, so I'm thinking if I could just detect and switch.
    Leslie Kirk
    Miva Certified Developer
    Miva Merchant Specialist since 1997
    Previously of Webs Your Way
    (aka Leslie Nord leslienord)

    Email me: [email protected]
    www.lesliekirk.com

    Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

    Comment


      #17
      Re: How to detect screen size?

      You might be able to do some of what you need using media conditionals:

      Code:
      /*** DESKTOP - ALL ***/
      @media screen and (min-width: 1024px){
      
      } /* END */
      
      
      /*** Mobile Phones Landscape ***/
      @media screen and (max-device-width: 640px) and (orientation: landscape){  
      
      } /* END */
      
      
      /***  Mobile Phone Portrait ***/
      @media screen and (max-device-width: 380px) and (orientation: portrait){
      
      } /* END */
      
      
      /* Mobile Phones Portrait or Landscape */
      /* @media screen and (max-device-width: 640px){ */
        
      }/* END */
      
      
      /* iPhone 4+ Portrait or Landscape */
      / @media screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2){ */
        
      }/* END */
      
      
      /* Tablets Portrait or Landscape  */
      /* @media screen and (min-device-width: 768px) and (max-device-width: 1024px){ */
        
      }/* END */
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #18
        Re: How to detect screen size?

        <mvt:doh> I forgot about the conditional that is part of the Toolkit Mobile Commerce

        Code:
        <mvt:if expr="('android' CIN s.http_user_agent OR 'iphone' CIN s.http_user_agent OR 'ipod' CIN s.http_user_agent OR 'webOS' CIN s.http_user_agent OR 'iemobile' CIN s.http_user_agent OR 'blackberry' CIN s.http_user_agent) AND NOT('tablet' CIN s.http_user_agent OR 'GT-P1000' CIN s.http_user_agent OR 'SCH-I800' CIN s.http_user_agent OR 'is_tablet' CIN s.http_user_agent OR 'is_tablet' CIN s.http_user_agent)">
        
        yada, yada, yada
        
        <mvt:else>
        
        more yada yada yada
        
        </mvt:if>
        </mvt:doh>
        Leslie Kirk
        Miva Certified Developer
        Miva Merchant Specialist since 1997
        Previously of Webs Your Way
        (aka Leslie Nord leslienord)

        Email me: [email protected]
        www.lesliekirk.com

        Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

        Comment

        Working...
        X