Skip to content

Instantly share code, notes, and snippets.

View arschmitz's full-sized avatar

Alexander Schmitz arschmitz

View GitHub Profile
@arschmitz
arschmitz / deeplink.js
Created January 21, 2013 02:39
jqm deeplinks
<div data-role="panel" id="panel-nav" data-position="left" data-display="overlay" data-theme="c">
<ul data-role="listview" data-inset="false" data-filter="true" data-theme="d" data-divider-theme="d" data-filter-placeholder="Search..." class="demo-nav">
<li><a href="../">Home</a></li>
<li><a href="../">Guides</a></li>
<li><a href="../">Demos</a></li>
<li><a href="../faq/">Q&A</a></li>
<li data-role="list-divider">Widget reference</li>
<li><a href="accordion/">Accordion</a></li>
<li><a href="ajax-nav/">AJAX Navigation</a></li>
<li><a href="autocomplete/">Autocomplete</a></li>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Buttons - jQuery Mobile Demos</title>
<link rel="stylesheet" href="../../../css/themes/default/jquery.mobile.css">
<link rel="stylesheet" href="../_assets/css/jqm-demos.css">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
$.widget( "mobile.fixedtoolbar", $.mobile.fixedtoolbar, {
_handlePageShow: function() {}
});
_getClosest: function( e ){
var thumbx = $( this.thumb ).offset().left,
thumb2x = $( this.thumb2 ).offset().left;
if(Math.abs(e.offsetX - thumbx) < Math.abs(e.offsetX - thumb2x)){
return true;
} else {
return false;
}
},
@arschmitz
arschmitz / nodeChanger.js
Created March 12, 2013 14:12
change node type
$el = $( "td:first" ).each( function(){
$( this ).replaceWith( "<th>"+ $( this ).html() + "</th>" );
});
@arschmitz
arschmitz / swipenav.js
Created March 18, 2013 13:01
modified version of js for jqm swipe nav to account for open panels
$( document ).on( "pageinit", "[data-role='page'].demo-page", function() {
var page = "#" + $( this ).attr( "id" ),
// Get the filename of the next page that we stored in the data-next attribute
next = $( this ).jqmData( "next" ),
// Get the filename of the previous page that we stored in the data-prev attribute
prev = $( this ).jqmData( "prev" );
// Check if we did set the data-next attribute
if ( next ) {
// Prefetch the next page
$.mobile.loadPage( next + ".html" );
(function( undefined ){
shoestring.merge = function( first, second ){
var l = second.length,
i = first.length,
j = 0;
if ( typeof l === "number" ) {
for ( ; j < l; j++ ) {
first[ i++ ] = second[ j ];
}
$.browser.oldIE = (function() {
var v = 3,
div = document.createElement( "div" ),
a = div.all || [];
do {
div.innerHTML = "<!--[if gt IE " + ( ++v ) + "]><br><![endif]-->";
} while( a[0] );
return v > 4 ? v : !v;
SCRIPT16389: Unspecified error.
jquery-1.9.1.js, line 3254 character 5
focus: {
// Fire native event if possible so blur/focus sequence is correct
trigger: function() {
error: if ( this !== document.activeElement && this.focus ) {
try {
this.focus();
return false;