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
$.urlParam = function(name){ | |
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href); | |
if (!results) { return 0; } | |
return results[1] || 0; | |
} | |
//http://snipplr.com/view/26662 |
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() { | |
$("a.topLink").click(function() { | |
$("html, body").animate({ | |
scrollTop: $($(this).attr("href")).offset().top + "px" | |
}, { | |
duration: 500, | |
easing: "swing" | |
}); | |
return false; | |
}); |
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 max_height = 0; | |
$("div.col").each(function(){ | |
if ($(this).height() > max_height) { max_height = $(this).height(); } | |
}); | |
$("div.col").height(max_height); | |
//http://web.enavu.com/tutorials/top-10-jquery-snippets-including-jquery-1-4/ |
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(){ | |
$(".thumbs img").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads | |
$(".thumbs img").hover(function(){ | |
$(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover | |
},function(){ | |
$(this).fadeTo("slow", 0.6); // This should set the opacity back to 60% on mouseout | |
}); | |
}); |
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
$('a[@rel$='external']').click(function(){ | |
this.target = "_blank"; | |
}); | |
/* | |
Usage: | |
<a href="http://www.catswhocode.com" rel="external">catswhocode.com</a> | |
*/ | |
//http://snipplr.com/view/315/-jquery--target-blank-links/ |
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 cache = []; | |
// Arguments are image paths relative to the current page. | |
$.preLoadImages = function() { | |
var args_len = arguments.length; | |
for (var i = args_len; i--;) { | |
var cacheImage = document.createElement('img'); | |
cacheImage.src = arguments[i]; | |
cache.push(cacheImage); | |
} |
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
in functions.php file | |
<?php | |
add_filter( 'pre_get_posts', function ( $query ) { | |
if ( $query->is_home() && $query->is_main_query() ) { | |
$example_term = get_term_by( 'name', 'featured', 'category' ); | |
$example_term_2 = get_term_by( 'name', 'Featured Post', 'category' ); | |
$example_term_3 = get_term_by( 'name', '1,000 Stories', 'category' ); | |
$example_term_4 = get_term_by( 'name', '1,000 Stories Spotlight', 'category' ); | |
$query->set( 'category__not_in', $example_term->term_id, $example_term_2->term_id, $example_term_3->term_id, $example_term_4->term_id ); |
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
/* | |
This file is part of JonDesign's SmoothGallery v1.2. | |
JonDesign's SmoothGallery is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. | |
JonDesign's SmoothGallery is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
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.getElementById("").onkeyup = function() { limitArea(this, '60', ''); } |
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
class Address(models.Model): | |
street = models.CharField(max_length=150) | |
street_slug = models.SlugField() | |
city = models.ForeignKey(City) | |
property_value = models.IntegerField(max_length=12, blank=True, null=True) | |
owner = models.ManyToManyField(Person, blank=True, null=True) | |
def __unicode__(self): | |
return self.street |
OlderNewer