mobile
Auto height on parent container with Absolute/Fixed Children
The parent div can not use height:auto when its children are positioned absolute / fixed. You would need to use JavaScript to achieve this. An example in jQuery: var biggestHeight = 0; // Loop through elements children to find & set the biggest height $(“.container *”).each(function(){ // If this elements height is bigger than the …
scale fit mobile web content using viewport meta tag
In the head add this //Include jQuery <meta id=”Viewport” name=”viewport” content=”initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no”> <script type=”text/javascript”> $(function(){ if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { var ww = ( $(window).width() < window.screen.width ) ? $(window).width() : window.screen.width; //get proper width var mw = 480; // min width of site var ratio = ww / mw; //calculate ratio if( ww …
Concise way of writing new DialogPreference classes?
The bare minimum is: MyCustomDialogPreference(Context context, AttributeSet attrs) constructor. Don’t forget to call super(context, attrs). Call setPersistent(false) to indicate to the super Preference class that you persist the preference value on your own. If you want to inflate the dialog panel layout from a resource, then also call setDialogLayoutResource(int dialogLayoutResId). onBindDialogView(View view) – update the …
differences between uiwebview and mobile safari [closed]
It doesn’t have the Nitro Javascript engine. This makes executing Javascript much slower in UIWebView compared to Safari. http://www.tuaw.com/2011/03/18/apple-confirms-some-webkit-optimizations-unavailable-to-ios-apps/ http://ariya.ofilabs.com/2012/06/nitro-javascriptcore-and-jit.html
When using @media queries, does a phone load non-relevent queries and images?
Behaviour is browser depended but iOS Safari and Android Chrome will respect the media queries and only download the background images for the applicable media queries. If you want to inspect this behaviour, try loading the page with Mobitest (http://mobitest.akamai.com/) or a tethered device. If you use separate CSS files (and I’d urge you not …
Is there a way to Fix a Google Maps Marker to the Center of its Map always?
Rather than injecting an HTML component as suggested in @Dr.Molle’s answer, why don’t you use a CSS only solution. It is simpler, more efficient and doesn’t require you to even touch the DOM (so there won’t be any problems if Google changes their implementation). Also since Google Maps doesn’t apply any styles on the container …
JavaScript caret position
I don’t know about autoNumeric, but http://code.google.com/p/jquery-formatcurrency/ looks pretty good. The jsFiddle example you posted doesn’t place the caret correctly on my desktop browser, but this does, and on my (Jellybean) Android phone as well. (On Gingerbread, the blinking cursor bar may jump to the end of the line, but you will still be editing …