question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Display semantic UI modal only for mobile and not for desktop

See original GitHub issue

I have use semantic ui model popup for showing data. In my case I want showing popup model in only mobile View. I have Use following code :

<div class="mini ui modal">
  <div class="image content">
    <div class="description">
      <div class="ui header">Showing FOr EROR</div>                     
      <p>USe data</p>
    </div>
  </div>
  <div class="actions">
    <div class="ui positive right labeled icon button">
      Yes                      
    </div>
  </div>
</div>

In JS $('.ui.modal').modal('show');

So how can i disable this popup for desktop view only view in Mobile thanks.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ComLockcommented, Aug 7, 2019

If it where a sidebar you could use:

$('#mySidebar').sidebar('is mobile')
1reaction
fridzemacommented, Mar 19, 2018

Something like this should work:

var md = new MobileDetect(window.navigator.userAgent);

if(md.tablet() || md.mobile()){
  $('.ui.modal').modal('show');
} else {
 // Do something else
}

http://hgoebl.github.io/mobile-detect.js/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Modal - Semantic UI
A modal displays content that temporarily blocks interactions with the main view of a site.
Read more >
Semantic-UI Modal Full Screen Variation - GeeksforGeeks
Semantic UI Modal displays content above the screen that temporarily blocks interaction with the main view of the website.
Read more >
semantic ui wont switch to mobile view - Stack Overflow
When the same page is viewed on a mobile device, the page appears like in a browser but very small and no mobile-view...
Read more >
semantic-ui/RELEASE-NOTES.md - UNPKG
- **Modal** - Modals now have a setting `centered` which can be used to disable vertical centering. This can be useful for modals...
Read more >
The Dialog element - HTML: HyperText Markup Language
The native HTML <dialog> element should be used in creating modal dialogs as it provides usability and accessibility features that must be ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found