Bootstrap modal doesn't work on iPhone - css

I'm using a Bootstrap modal dialog on my site (which works fine on desktop). When I try to use this function on iPhones and iPads, the modals do not work.
Is there a reason for this? Has anyone come up with a fix for this whilst using Bootstrap's CSS via #import?
I use the Bootstrap override file to make changes to the Bootstrap CSS.

I had the same problem these days and figured out, that safari on iOS is working differently to other browsers with respect to one thing. The modal window is not shown on safari but on many other browsers, when there is a href="#" missing.
not working on Safari/iOS but other browsers:
<li><a data-toggle="modal" data-target="#testModal">Modal</a></li>
working on Safari/iOS and other browsers:
<li>Modal</li>

The iPhone's browser doesn't seem to support the modal's "fade" transition. Disable it entirely from your modal dialog box, or if you want to get fancy, disable only when your site detects an iPhone device:
This doesn't work on the iPhone
<div class="modal hide fade" id="deleteConfirmation">
This does
<div class="modal hide" id="deleteConfirmation">

please check out http://jschr.github.com/bootstrap-modal/ as it fixes a bunch of the modal issues.. all you'll have to do is just include the 2 js files --
- bootstrap-modalmanager.js
- js/bootstrap-modal.js
and it just works

I know I'm a little late to this party but I was having the same problem and came across a solution that solved it. In case anyone else is having the same problem and finds this question doing a search here is the answer:
Add the class "clickable" to whatever you're tapping on with your iOS device that's supposed to open the modal. I assume you're using a div because an a tag or button should work just fine. Then in your CSS put this:
.clickable {
cursor:pointer;
}
This is not a Bootstrap problem, it's an iOS problem. The pointer lets iOS know that whatever you're tapping on is clickable, which normally doesn't include a div.
I won't take credit for this answer, I found it here:
Bootstrap Modal does not work on iOS devices

this is still an open issue on the Bootstrap Project:
https://github.com/twitter/bootstrap/issues/2130

This may be caused by incorrect dialog positioning. try playing with the "top" setting in the .modal class.

I had similar error on my mobile device (Android OS).
Modal works fine on desktop but on mobile doesn't work.
Problem was in my wrong definition of grid layout.
So, define .col-xs in any column of your layout, that worked for me.

I also had the same problem where my button to trigger Modal was not working on iPhone. I had to convert the <a> tag with Rails link_to and providing all possible attributes. ie.,
= link_to "Open Modal", '#', :remote => true, "data-backdrop" => "modal-backdrop", "data-toggle" => "modal", "data-target" => "#myModal"

Very easy, just add the an inline style, "cursor" to pointer and it will work straight away. style="cursor:pointer;"
<li><a data-toggle="modal" data-target="#testModal" style="cursor:pointer;">Modal</a></li>

If you're trying to display a modal during form submission, then you'll need to make sure the modal is activated before the submit event. This is because iOS Safari doesn't allow animations during form submission.
I was displaying my modal after jquery validation completed, which was too late. So instead I show the modal on button click, and dismiss it if jquery validation fails during the submit event.

Related

GWT Bootstrap3 Button icons show up very late (lag)

In the video i uploaded on screencast you see the reload of my GWT Bootstrap3 (see https://gwtbootstrap3.github.io/gwtbootstrap3-demo/) project. The page I display is almost empty (so there are not other icons which need to be displayed).
The video starts when I hit the F5 key on my chrome browser. You'll notice that the screen reloads then the buttons show up as blank squares which are then filled oiut with the icons.
http://www.screencast.com/t/dd7B9lr6
How can I manage to show them up with their icons immediately
The buttons are placed within a Vertical Panel as a ButtonToolbar within ButtonGroups
[...]
<g:VerticalPanel addStyleNames="{styles.tables.listBeanTable} ub-AbstractSummaryWidget">
<b:ButtonToolBar addStyleNames="{styles.summary.menuBar} hiddenPrint">
<b:ButtonGroup >
<b:Tooltip title="{msgs.refresh}" container="body">
<b:Button ui:field="refreshButton" icon="REFRESH"/>
</b:Tooltip>
<b:Tooltip title="Delete meeting" container="body">
<ui:attribute name="title" description="Label for button: delete meeting"/>
<b:Button ui:field="deleteMeetingButton" visible="false" icon="REMOVE"/>
</b:Tooltip>
[...]
I am not sure whether exactly when the icons are drawn to replace the squares. Is it with the call to " initWidget(uiBinder.createAndBindUi(this));" within the constructor class of the widget?
If you were about to say: hey buy a more powerfull laptop then it'll display faster. The gwtbootstrap3 example (e.g. https://gwtbootstrap3.github.io/gwtbootstrap3-demo/#icons) ) shows up immediately correct.
Thanks for any help
Hannes
The icons are loaded from Font Awesome. They are just <i> tags with the appropriate CSS style applied - this style forces the content of the <i> tag to become the desired icon. My bet is that the problem is that the font is not being loaded "fast enough". Maybe it's not cached? Maybe it's loaded from a slower server? Check your browser's developer tools to see from where the font is loaded and how long it takes. It should loaded from a folder relative to your webapp, unless maybe when you are using the GwtBootstrap3CDN.gwt.xml module.
What really resolved the issue was the change to gwt 2.7. all performance issues disappeared.
Furthermore in the case above it helped a bit to set the ButtonToolBar invisible (setVisible("false")) in the ui.xml. and at the end of the Ctor make it visible "setVisible("true).

twitter bootstrap class visible-* dont work on mobiles and tablets

I'm trying to use visible-xs,visible-sm,visible-md on a div like this: <div class="badge" class="visible-xs visible-sm">text</div>
But this not seems to work on mobile phone or tablet, on desktop however this works when i manipulate with window, on mobiles it works when i switch browser to "show as desktop".
Strange is that, everything else works, even the classes hidden-*
Does anyone have any suggestion, how to solve this?
visible-* should work fine with mobile devices.
show us an example please.
According to Twitter Bootstrap's website: http://getbootstrap.com/css/#responsive-utilities-classes
If you are using the current version of Bootstrap: 3.2.0, this is now no longer kosher. It should still be able to work, but you may want to try .visible-sm-*. The * is often a place holder for block, inline, or inline-block. Ex: .visible-sm-inline
That being said, I have found leaving the * also works. Ex: .visible-sm-* will hide things on small devices.
Don't use more than one class block on your div, or it will get only the first classname. Try like this:
<div class="badge visible-xs visible-sm">text</div>
As seen in:
http://www.w3.org/TR/html5/dom.html#classes

inline styling with erb works in Safari, but not Chrome

When I inspect the element in Chrome, the code is being generated with the correct URL – but the image does not display until I either refresh the page or change an attribute of the styling from Chrome's inspector panel. This bug does not occur in Safari.
I've found that if I remove turbolinks, it works in both browsers. As a side note, I am also using jquery.turbolinks gem.
<div id='show-hero' style='background: url("<%= #roaster.roaster_image_url %>") no-repeat center top;'></div>
Any idea would be greatly appreciated.
I've experienced this same behavior when using inline styles to assign background-image in Rails 4 with Turbolinks enabled.
It's hacky, but my current workaround is to assign the background image with a bit of js/jquery at the bottom of the view, and bind it to a page load event (more info on turbolinks and page load events here: https://stackoverflow.com/a/18770589/1769539 )
Here's an example of what your JS might look like:
<script>
function ready() {
$("#show-hero").css({
"background-image":"url(<%= #roaster.roaster_image_url %>)",
"background-repeat":"no-repeat",
"background-position":"center top"
});
};
$(document).ready(ready);
$(document).on('page:load', ready);
</script>

jQuery Mobile and fullcalendar css conflict

I am new to Android and jQuery Mobile.
I am using fullcalendar in jQuery Mobile.
as you can see the event title is bold and blur,
the fullcalendar header also not fits perfectly when test at Samsung Galaxy II.
The original fullcalendar fonts is nice and sharp.
If I test remove this jQuery Mobile theme css it will work fine, I guess is jQuery Mobile css crash with fullcalendar css. Sorry, I have not much experience in css.
<link rel="stylesheet" href="http://dl.dropbox.com/u/41465102/android-theme.min.css" />
So, please guide me
how to make event title font exactly like the original
the full calendar header is fits perfectly in mobile
For fixing the event title font,remove the text shadow from it using the following css:
.fc-event-title{
text-shadow:none;
}
Updated fiddle - http://jsfiddle.net/JaaQg/5/

:hover is not working properly in IE9

I have a simple CSS dropdown menu with an iframe inside it. When I hover my mouse over the dropdown menu, the menu drops down. But when my mouse hovers the iframe inside the menu, the menu goes back. Here's a simplified version of my code:
<div id="comments">
View comments
<div id="comment-wrap">
<iframe src="http://www.facebook.com/plugins/comments.php?..."></iframe>
</div>
</div>
<style type="text/css">
#comment-wrap{display:none;z-index:5;position:absolute;padding:10px;background-color:#fff;}
#comments:hover #comment-wrap{display:block;}
</style>
This works in the latest versions of FF, Chrome, and Opera.
P.S. The dropdown menu remain dropped down when my mouse is hovering the padding of #comment-wrap.
I have faced similar problems while working with the :hover psuedo class. It started working fine when I changed the Document mode of the browser to IE 9 and the Browser mode also set to IE9. IE 9 has the document mode set to IE8 by default.
Additionally, you can add the following meta info in the head tag:
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
Hope this helps.
I found to have the same problem and i know this is already an old post but i felt like i had to publish my solution. Basicly IE does not accept the :hover event for any tags other than <a> with specified href (wont work on early ie versions), unless you add <!DOCTYPE HTML> at the top. And that was it! Problem solved :).
Unfortunately, this seems to be a browser bug, going back many IE versions. You can use a JS solution as a backup to IE. I've created a jsFiddle example, adapting code from another solution addressing this issue.
Hope that helps!
Edit: further testing in IE9 shows that though the iframe is displayed, hovering over the scrollbars hides it immediately. There is likely a more involved JS fix for this, but it's up to you if you'd like to implement it.
I recently had a hover issue in IE10 (not sure about lower versions) that was driving me crazy. I had my css hover set properly and it was for a div that contained an iframe. The issue was that when you hovered the div it would show the iframe but as soon as you tried to move the mouse into the iframe it would disappear again. I searched everywhere and found nothing for an acceptable answer for me except to use javascript or jquery. After days of trying to sort it out I found a very simple solution that worked for me. I simply removed the iframe from the div and used the object such as
<div class='showme'>links<div style='float:left;' class='showme_1'>
<object type='text/html' data='http://www.google.com' style='width:100%; height:100%' border='0'>
</object>
</div>
I hope this helps folks save a lot of research time.

Resources