Skip to content

Instantly share code, notes, and snippets.

View scullygroup's full-sized avatar

Scully Group scullygroup

View GitHub Profile
@scullygroup
scullygroup / gist:37571
Created December 18, 2008 17:43
jQuery nav hover class
$('#main-nav ul li').each(function() {
$(this).hover(function() {
$(this).addClass('nav-on');
}, function() {
$(this).removeClass('nav-on');
});
});
@scullygroup
scullygroup / swfobject embed code
Created December 19, 2008 20:12
swfobject embed code
var flashvars = {};
var params = {
menu: "false",
wmode: "transparent"
};
var attributes = {};
swfobject.embedSWF("swf/slideshow.swf", "flash-header", "1000", "317","9.0.0", "", flashvars, params, attributes);
@scullygroup
scullygroup / gist:42543
Created January 2, 2009 14:40
sIFR snippet
<script type="text/javascript" charset="utf-8">
if(typeof sIFR == "function"){
sIFR.replaceElement(named({sSelector:"h1", sFlashSrc:"<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/swf/sifr.swf", sColor:"#404e1c", sWmode:"transparent"}));
sIFR.replaceElement(named({sSelector:"h2.contentheading, #content h2, #content h3", sFlashSrc:"<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/swf/sifr.swf", sColor:"#404e1c", sWmode:"transparent"}));
};
</script>
@scullygroup
scullygroup / states.sql
Created January 2, 2009 15:59
US States SQL INSERT
CREATE TABLE IF NOT EXISTS `states` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`abbr` varchar(2) NOT NULL,
`name` varchar(250) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=52 ;
INSERT INTO `states` (`id`, `abbr`, `name`) VALUES
(1, 'AL', 'Alabama'),
(2, 'AK', 'Alaska'),
@scullygroup
scullygroup / gist:42581
Created January 2, 2009 16:01
Google Maps custom, clickable marker
<div id="map"></div>
<script type="text/javascript">
// Create a base icon
var baseIcon = new GIcon();
baseIcon.image = "images/red_marker.png";
baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
baseIcon.iconSize = new GSize(20, 34);
baseIcon.shadowSize = new GSize(37, 34);
baseIcon.iconAnchor = new GPoint(9, 34);
@scullygroup
scullygroup / gist:42583
Created January 2, 2009 16:02
Google Maps, use KML file from "My Maps"
<div id="map"></div>
<div id="controls">
<p class="legend"><strong>Toggle a Checkbox to Show Map Points</strong></p>
<ul>
<li><input type="checkbox" id="layer1" onClick="boxclick(this, layer1);"/><label> Layer 1 </label></li>
<li><input type="checkbox" id="layer2" onClick="boxclick(this, layer2);"/><label> Layer 2 </label></li>
<li><input type="checkbox" id="layer3" onClick="boxclick(this, layer3);"/><label> Layer 3</a></label></li>
@scullygroup
scullygroup / gist:42588
Created January 2, 2009 16:08
jQuery form validation, on-ready event
//contact-form validation
$("form#contact-form").validate({
errorPlacement: function(error, element) {
//appends error message to the p tag of the form field
error.appendTo( element.parent("p") );
}
});
@scullygroup
scullygroup / gist:42590
Created January 2, 2009 16:11
jQuery image-based nav rollovers
$(document).ready(function() {
// Preload all rollovers
$("#tabs img").each(function() {
// Set the original src
rollsrc = $(this).attr("src");
rollON = rollsrc.replace(/.jpg$/ig,"2.jpg");
$("<img>").attr("src", rollON);
});
// Navigation rollovers
<?php
$id = JRequest::getVar( 'id', 0 );
$content = JTable::getInstance('content');
$content->load($id);
$cat_id = $content->catid;
$category = JTable::getInstance('category');
$category->load($cat_id);
$category_title = $category->title;
src="<?php echo $this->baseurl ?>/swf/blah.swf"