This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() | |
{ | |
$('button').click(function() { | |
// Check if it should be persistent (can set to a normal bool if you like!) | |
createGrowl( $(this).hasClass('persistent') ); | |
}); | |
// Make it a window property see we can call it outside via createGrowls() at any point | |
window.createGrowl = function(persistent) { | |
// Use the last visible jGrowl qtip as our positioning target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if( parseFloat(((/CPU.+OS ([0-9_]{3}).*AppleWebkit.*Mobile/i.exec(val)) || [0,'4_2'])[1].replace('_','.')) < 4.1) { | |
$.fn.Oldoffset = $.fn.offset; | |
$.fn.offset = function() { | |
var result = $(this).Oldoffset(); | |
result.top -= window.scrollY; | |
result.left -= window.scrollX; | |
return result; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var iOS = parseFloat( | |
('' + (/CPU.*OS ([0-9_]{1,5})|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0,''])[1]) | |
.replace('undefined', '3_2').replace('_', '.').replace('_', '') | |
) || FALSE; | |
if((iOS > 3.1 && iOS < 4.1) || (iOS >= 4.3 && iOS < 4.33)){ | |
$.fn._oldOffset = $.fn.offset; | |
$.fn.offset = function() { | |
var result = $.fn._oldOffset.call(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Entity = function(params) { | |
this.merge(Entity.defaults); | |
this.merge(params); | |
}; | |
Entity.defaults = { | |
position: [0, 0], | |
velocity: [0, 0], | |
acceleration: [1, 1] | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Outputs a float representing the iOS version if user is using an iOS browser i.e. iPhone, iPad | |
* Possible values include: | |
* 3 - v3.0 | |
* 4.0 - v4.0 | |
* 4.14 - v4.1.4 | |
* false - Not iOS | |
*/ | |
var iOS = parseFloat( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pollute() { | |
var foo = bar = 'uhoh'; // bar pollutes upper scope! | |
} | |
pollute(); // Execute the pollution! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pollute() { | |
var foo = 'uhoh', | |
bar = foo; // bar is in local scope, no pollution! | |
} | |
pollute(); // Execute the pollution..? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create new object to cache iframe offsets | |
$.ui.ddmanager.frameOffsets = {}; | |
// Override the native `prepareOffsets` method. This is almost | |
// identical to the un-edited method, except for the last part! | |
$.ui.ddmanager.prepareOffsets = function (t, event) { | |
var i, j, | |
m = $.ui.ddmanager.droppables[t.options.scope] || [], | |
type = event ? event.type : null, // workaround for #2317 | |
list = (t.currentItem || t.element).find(":data(ui-droppable)").addBack(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
<title>Flip bug with Overflow</title> | |
<link rel="stylesheet" type="text/css" href="http://cdn.jsdelivr.net/qtip2/2.1.1/jquery.qtip.css"> | |
<link rel="stylesheet" type="text/css" href="qtip-bug.css"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script type="text/javascript" src="http://cdn.jsdelivr.net/qtip2/2.1.1/jquery.qtip.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Bootstrap 3 - Disabled dropdown links | |
Bootstrap 3 has built-in visual support for disabled dropdown menu items, however these are simply | |
visual changes and don't actually impact the interactivity of the element itself. | |
Once this is added to your styles, you can easily disable any dropdown item by applying a [disabled] attribute | |
to the <a/> element itself, and adding the usual .disabled class to the parent <li>. | |
More information here: http://blog.craigsworks.com/bootstrap-3-disabled-dropdown-links/ |
OlderNewer