Skip to content

Instantly share code, notes, and snippets.

View Caspert's full-sized avatar

Casper Biemans Caspert

View GitHub Profile
@Caspert
Caspert / jquery.fullscreenr.js
Last active August 29, 2015 12:10 — forked from thebird/jquery.fullscreenr.js
Did this really quickly and havent tested but should show a few ways to speed up from the current code. Hope this is helpful :)
(function($){
$.fn.fullscreenr = function(options) {
if(options.height === undefined) alert('Please supply the background image height, default values will now be used. These may be very inaccurate.');
if(options.width === undefined) alert('Please supply the background image width, default values will now be used. These may be very inaccurate.');
if(options.bgID === undefined) alert('Please supply the background image ID, default #bgimg will now be used.');
var defaults = { width: 1280, height: 1024, bgID: 'bgimg' },
options = $.extend({}, defaults, options);
$(document).ready(function() { $(options.bgID).fullscreenrResizer(options); });
$(window).bind("resize", function() { $(options.bgID).fullscreenrResizer(options); });
return this;
@Caspert
Caspert / WordPress Function.php
Created April 10, 2015 21:29
Simple functions.php theme file for WordPress custom themes
<?php
// Define and creating constants
define('TEMPPATH', get_bloginfo('stylesheet_directory')); // Path to the theme directory
define('IMAGES', TEMPPATH. "/images"); // IMAGES uses TEMPPATH and appends the image folder
// Add theme support for custom menu
add_theme_support('nav-menus');
if(function_exists('register_nav_menu')) {
// This theme uses wp_nav_menu() in one location.