Skip to content

Instantly share code, notes, and snippets.

View stvedt's full-sized avatar

Sven Tvedt stvedt

View GitHub Profile
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Accurate Viewport with jQuery</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
var viewPort = $(window);
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Tab Alerts</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
var baseTitle = document.title;
setInterval(updateTitle, 2000);
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Page Loading</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
</head>
<body>
<p>This is a paragraph</p>
$(document).ready(function() {
$('input').keyup(function(){
var $this = $(this);
var characters = $this.val().length;
var maxLength = $this.attr('maxLength');
if( characters == maxLength){
$this.next().focus();
}
});
<form action="" method="post" name="mobile-usability">
Username: <input name="email" type="text" size="20">
</form>