Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created April 16, 2014 19:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaredatch/10921549 to your computer and use it in GitHub Desktop.
Save jaredatch/10921549 to your computer and use it in GitHub Desktop.
Fancybox with small devices
jQuery(document).ready(function($){
// Small device?
var small_device = false;
if(window.innerWidth < 500 || window.innerHeight < 500 || window.outerWidth < 500 || window.outerHeight < 500) {
small_device = true;
}
// Fancybox
if(small_device == true) {
$('.login-modal a').attr("href", "http://www.domain.com/login");
$('.get-started').attr("href", "http://www.domain.com/create");
} else {
$('.modal, .login-modal > a').fancybox({
padding: [ 70, 35, 35, 35 ],
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment