0

I have a web application which has an upload feature. I want to disable that button when the page is viewed via ipad.

Is that possible. My thoughts are to check the resolution. But what if the resolution of the device increases?

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
Praveen S
  • 104
  • 11

2 Answers2

0

Try checking the user agent in PHP. See this question. Then, echo comment tags if it matches the expected user agent for an iPad user.

Community
  • 1
  • 1
Brian Hannay
  • 522
  • 4
  • 19
  • Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. And what makes you think this has anything to do with PHP? – Matt Ball Jan 16 '13 at 05:14
  • Thanks, I'm sorta new here :P. The question doesn't have anything to do with PHP, but I believe it is a solution to the question. – Brian Hannay Jan 16 '13 at 05:47
0

Use CSS Media Queries

For just iPad related CSS, you can use this:

@media only screen
and (min-device-width : 768px)
and (max-device-width : 1024px) {
  .no-ipad {
    display: none;
  }
}

Add the class no-ipad for making the elements not displayed on iPad.

For Android (if you need)

@media only screen
and (min-device-width : 320px)
and (max-device-width : 480px) {
  .no-android {
    display: none;
  }
}

Add the class no-android for making the elements not displayed on Android.

Community
  • 1
  • 1
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252