you are here: codestackercodes [RSS] → tag html [RSS]

useful html5 attributes for iOS

<!-- For a username, you don't want to autocorrect, nor do you want a capitalised first letter. -->
<input type="text" autocorrect="off" autocapitalize="off">

<!-- Turn telephone detection off -->
<meta name="format-detection" content="telephone=no" />

<!-- Make webpage an app (get rid of top bar) when bookmarked to home screen -->
<meta name="apple-mobile-web-app-capable" content="yes" />

<!-- Number keyboards -->
<input type="tel" /> <input pattern="[0-9]*">

<!-- URL/Emails -->
<input type="url"> <input type="email">

<!-- Links -->
<a href="http://maps.google.com/maps?q=Moon">Open in Google Maps</a>
<a href="tel:01234567890">Open the phone</a>
<a href="twitter:Tweet Tweet Tweet">Open the Twitter for iPhone app</a>

back to top

<a href="#top" onclick="$('html, body').animate({scrollTop:0}, 'slow'); return false;">top</a>

unobstrusive popup

http://www.quirksmode.org/js/popup.html

   function popup(url) {
        newWindow = window.open(url, 'name', 'height=400,width=335,scrollbars=yes');
        if (window.focus) { newWindow.focus() }
            return false;
    }

// <a href="link.html" onclick="popup('link.html');">Link</a>
Displaying all 3 Code