Skip to content

Instantly share code, notes, and snippets.

@markthelefty
markthelefty / gist:6770342
Created September 30, 2013 21:10
jquery-center.js
/**
* @author Alexandre Magno
* @desc Center a element with jQuery
* @version 1.0
* @example
* $("element").center({
*
* vertical: true,
* horizontal: true
*
@markthelefty
markthelefty / gist:5702910
Created June 4, 2013 01:23
This is a simple example of using Enquire.js to load AJAX content based on screen width (media queries). In the below example 480.html is loaded via AJAX when the browser is 0px to 959px. From 960px and up 960.html is loaded. They are switched when the browser window shrinks.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Enquire Test</title>
<meta name="viewport" content="width=device-width">
<!-- Normalize CSS -->
<link rel="stylesheet" src="http://normalize-css.googlecode.com/svn/trunk/normalize.css"/>
<!-- Bootstrap CSS -->