1

I am working with a mobile SharePoint 2013 page and need some things to not appear on it. I only want certain apps to show on the mobile view of our website. There are some list and document files that I need to only appear on the computer browser but not on the mobile view of the same site.

  • Can you be more specific. What exactly are you trying to hide and on what pages? – Colbs Jun 14 '17 at 15:40
  • Do you mean not to show the web part when you open the same pages in mobile? The mobile pages are same that you see on desktop? – Venkat Konjeti Jun 14 '17 at 15:42
  • The mobile site is too cluttered and I need to hide some document libraries and lists. But since it is the same webpage just formatted different I was wondering If there is a way to make only certain things appear on the mobile view of it. – Garrett Jun 14 '17 at 16:59
0

As you are looking to hide some of the content on mobile devices. You should use media queries in CSS.

Here is my approach which can be managed easily.

Attach a class to the web parts which need to hide in mobiles

I am using a jQuery to attach a class to my list view web parts. The following code I added using script editor web part to the pages where I need this change.

$("#web-part-d").addClass("hide-mobile");

Add CSS

The following CSS I added to the common.css which has been added to the master page.

@media (max-width:992px) { //this is for iPad
   .hide-mobile {
      display: none;
   }
} 

@media (max-width:767px) { //this is for mobile
   .hide-mobile {
      display: none;
   }
}

If you want this for only one page add the above CSS and JavaScript to the Script Editor web part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.