0
Welcome Guest! Login
0 items Join Now

Responsive Classes for only visible on desktop

    • Paul M30's Avatar
    • Paul M30
    • Jr. Rocketeer
    • Posts: 20
    • Thanks: 1

    Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • The function Responsive Classes only lets me show on desktops 960px AND 1200px (visible-desktop). I only what to show something on 960px.

      What I want it for is Adsense. I want to show a different AD size on every breakdown. But with the standard functionality it shows two ads when at 1200px.

      Is there a possibility to show only on 960px?

      This image is hidden for guests.
      Please log in or register to see it.
    • cdavis411's Avatar
    • cdavis411
    • Preeminent Rocketeer
    • Posts: 17787
    • Thanks: 882

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • Is this site online? If so, please provide the URL to the issue.
      :)
    • Paul M30's Avatar
    • Paul M30
    • Jr. Rocketeer
    • Posts: 20
    • Thanks: 1

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • The site isn't online :cry: . But I don't think thats necessery. Look at option 3 in the image I posted (visible-desktop), there is desktop 960 AND 1200 visible. I want only desktop 960 to be visible.
    • cdavis411's Avatar
    • cdavis411
    • Preeminent Rocketeer
    • Posts: 17787
    • Thanks: 882

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • okay I see what you are thinking.
      you can create your own class for this like visible-960only

      add this to your custom css file:
      .visible-960only {display: none !important;}
       
      @media only screen and (min-width: 960px) and (max-width: 960px) {
      body .visible-960only {display: inline-block !important;}
      }
       
      If you are using Gantry 4 (or later) you can create a file using a simple text editor for custom css and name it using this format: templatefolder-custom.css (e.g., rt_kirigami-custom.css or gantry-custom.css).

      OKAY NOW that I showed you how to do it I should tell you that this is not going to work well as a solution. Because it will only show when the screen size is exactly 960px wide. That is why the current range. You can however play with the min and max widths to get closer to what you want.
    • The following users have thanked you: Ruy Gonzalo Martinez Allende

    • Paul M30's Avatar
    • Paul M30
    • Jr. Rocketeer
    • Posts: 20
    • Thanks: 1

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • Desktop only is 960 to 1199, desktop large is 1200 +. Than I should look like this:
      .visible-960only {display: none !important;}
       
      @media only screen and (min-width: 960px) and (max-width: 1199px) {
      body .visible-960only {display: inline-block !important;}
      }

      So I put the above tekst in a new file called templatefolder-custom.css, because I use Gantry 4. Where do I put it? I use template Chapelco.
    • The following users have thanked you: Ruy Gonzalo Martinez Allende

    • cdavis411's Avatar
    • cdavis411
    • Preeminent Rocketeer
    • Posts: 17787
    • Thanks: 882

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • Paul M30's Avatar
    • Paul M30
    • Jr. Rocketeer
    • Posts: 20
    • Thanks: 1

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • cdavis411 wrote:
      1) If you are going to have it be 960 - 1199 just user the module class suffixes visible-desktop hidden-large

      Ok, you say thats an option? I tried that allready, but that doesn't work. Then it's shown in every breakdown. As if the both classes visible-desktop and hidden-large are ignored.

      Are you sure that works?
    • cdavis411's Avatar
    • cdavis411
    • Preeminent Rocketeer
    • Posts: 17787
    • Thanks: 882

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • what template are you using?
    • cdavis411's Avatar
    • cdavis411
    • Preeminent Rocketeer
    • Posts: 17787
    • Thanks: 882

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • okay I see what you are referring to now. it is the inherit property that is causing that,

      just add this to your custom css file:
      @media only screen and (min-width: 1200px){
           .visible-desktop.hidden-large {display: none !important;}
      }
      If you are using Gantry 4 (or later) you can create a file using a simple text editor for custom css and name it using this format: templatefolder-custom.css (e.g., rt_kirigami-custom.css or gantry-custom.css).
    • Paul M30's Avatar
    • Paul M30
    • Jr. Rocketeer
    • Posts: 20
    • Thanks: 1

    Re: Responsive Classes for only visible on desktop

    Posted 11 years 5 months ago
    • cdavis411 wrote:
      what template are you using?

      I use template Chapelco.

Time to create page: 0.057 seconds