adaptive-layout

How to load or not a JS script (into the head section) based on screen resolution?

大城市里の小女人 提交于 2019-11-29 15:47:22
on a website, I have these lines on the tag <script type="text/javascript" src="http://www.domain.com/js/jquery.min.js"></script> <script type="text/javascript" src="http://www.domain.com/js/jquery.colorbox.min.js"></script> <script type="text/javascript" src="http://www.domain.com/js/inner-code-colorbox.min.js"></script> Which are loading JS code, that shouldn't be loaded at all on portable systems Is there a way to do it? I tried in this way: <script type="text/javascript" media="only screen and (min-width: 950px)" src="http://www.domain.com/js/jquery.min.js"></script> But it's not working

iOS 8 presentationController determine if really is popover

坚强是说给别人听的谎言 提交于 2019-11-29 01:27:00
I'm using the new adaptive "Present As Popover" capability of iOS 8. I wired up a simple segue in the StoryBoard to do the presentation. It works great on an iPhone 6 Plus as it presents the view as a popover and on an iPhone 4s it shows as a full screen view (sheet style). The problem is when shown as a full screen view, I need to add a "Done" button to the view so dismissViewControllerAnimated can be called. And I don't want to show the "done" button when it's shown as a popover. I tried looking at the properties of both presentationController and popoverPresentationController, and I can