From This Site

Simple Menu
	$.fn.JB_menu = function(options) {
		var 
			defaults = {
				hiddenMenu: 'ul',
				slideTime: 300
			},
			settings = $.extend({}, defaults, options);
		
		this.each(function() {
			// cache this and at the same time make sure it children are hidden
			var $this = $(this);
			$this.children('ul').hide().end();
			
			$this.hover(function() {
				// mouseover
				// the title tooltip gets in the way so remove it 
				if ($this.children('ul').is(':hidden')) {
					$this.children('a').removeAttr('title');
					// find the nested ul to display it
					$this.find('> ul').stop(true, true).slideDown(settings.slideTime);
				}	
	 		}, function() {
	 			// mouseout
	 			$this.find('> ul').stop(true, true).hide(); 		
			});
			
		});
		
		// returns the jQuery object to allow for chainability
		return this;
		
	} //end JB_menu

SeatExpert.com Testing

//make jQuery plugins
(function($){
	// SEATEXPERT.COM Seat Comments
	// Author: Jamie broussard
	// created: 2011-01-05
	// Modified: 2011-01-21
	// delegate the hover function to seat divs class on plane.php
	// depends on wz_tooltip.js for Tip() function
	// div ids on the page must match array values 
	// usage: in the document ready function
	// $('.yourclass').SE_seat_comments(yourjson,{options});
	/* EXAMPLE
	
*/ $.fn.SE_seat_comments = function(options, seatmap) { // chache this for good practice var $this = $(this); // functions protected in Comments name space var Comments = { initToolTip: function() { options = $.extend({ toolTipClass: 'div.seat-tip', eventType: 'mouseover', seatHoverColor: "#224588", animateTime: 200, planeID: "", ajaxURL: "jb_test_seatmap.php" }, options); if (!seatmap) { this.loadSeatmapData(); } else { this.showToolTip(seatmap); } }, createToolTip: function(seatDetails, seatNumber) { Tip( Comments.buildOutput(seatDetails, seatNumber) ); }, buildOutput: function(seatDetails, seatNumber) { // var init var v1, v2, v3, v4, i = 0, x = 0, y= 0, top_section = "", p_comment = "", n_comment = "", return_comment = "", ife = new Array(16), seat_type = new Array(8), power_type = new Array(8), p = new Array(32), n = new Array(32); // this is all about setting up based on the hexadecimal array passed to this s = seatDetails[0]; v1 = s % 16; v2 = s >>> 4; v2 = v2 % 256; v3 = s >>> 12; v3 = v3 % 16; v4 = s >>> 16 v4 = v4 % 16; // IFE ife[0] = "None"; ife[1] = "AVOD"; ife[2] = "Audio only"; ife[3] = "Over-head monitor"; ife[4] = "Projection screen"; ife[5] = "Satellite radio"; ife[6] = "Live TV"; ife[7] = "non-AVOD personal screen"; ife[8] = "Hand-held video player"; ife[9] = "unknown"; // Seat type seat_type[0] = "Individual suite"; seat_type[1] = "Full-flat sleeper"; seat_type[2] = "Slanted flat seat"; seat_type[3] = "Recliner"; seat_type[4] = "Non-reclining seat"; seat_type[5] = "Standard seat"; // Power power_type[0] = "None"; power_type[1] = "emPower"; power_type[2] = "110V universal"; power_type[3] = "Shared 110V universal"; power_type[4] = "15V DC Cigarette Lighter"; power_type[5] = "DC power ports"; power_type[6] = "Shared emPower"; power_type[7] = "Shared 15V DC Cigarette Lighter"; power_type[8] = "Shared DC power ports"; power_type[9] = "unknown"; // to section top_section = "
Seat:" + seatNumber[0] + "Type:" + seat_type[v3] + "
Power:" + power_type[v4] + "IFE:" + ife[v2] + "
    "; // negative comments p[0] ="This is an average seat in this cabin"; p[1] ="No adjacent middle seat"; p[2] ="Increased legroom"; p[3] ="No seat behind this seat"; p[4] ="Layout allows easy aisle access for row mates"; p[5] ="Additional space/Increased privacy"; p[6] ="Wider than the average seat in this cabin"; p[7] ="Additional storage"; p[8] ="Bulkhead/Seat in front doesn't recline"; p[9] ="Easy aisle access"; p[10] ="See general aircraft comments"; // positive comments n[0] ="Reduced storage space"; n[1] ="Heavy traffic area"; n[2] ="Close to restrooms"; n[3] ="Obstructed window view"; n[4] ="No window view"; n[5] ="Non-moveable armrest"; n[6] ="Restricted legroom"; n[7] ="Requires an additional fee to book"; n[8] ="Seat subject to increased contact from aisle traffic"; n[9] ="Narrower than average seat in this cabin"; n[10] ="No air vent"; n[11] ="Restricted recline"; n[12] ="No recline"; n[13] ="Reduced privacy"; n[14] ="Seat is rear facing"; n[15] ="Crew rest"; // negative comments y = seatDetails[1]; for (i=0; i < 32; i++) { if ( (y % 2) == 1) { n_comment = n_comment + "
  • - " + n[i] + "
  • "; } y = y >>> 1; } // positive comments x = seatDetails[2]; for (i=0; i < 32; i++) { if ( (x % 2) == 1) { p_comment = p_comment + "
  • + " + p[i] + "
  • "; } x = x >>> 1; } // then set up the output return_comment = top_section; return_comment = return_comment + p_comment; return_comment = return_comment + n_comment + "
"; return (return_comment); }, showToolTip: function(seatmap) { $this.delegate(options.toolTipClass, options.eventType, seatmap, function(){ // from the array seatmap passed to this function // match the div id with the coresponding array elem var $thisSeat = $(this), divId = $thisSeat.attr("id"), seatDetails = seatmap[divId][0], seatNumber = seatmap[divId][1], origColor = $thisSeat.css("background-color"); // mouseover for main site only // click or other event for mobile site or clients if (options.eventType == 'mouseover') { // flash the seat $thisSeat .animate( { backgroundColor: options.seatHoverColor}, options.animateTime ) .animate( { backgroundColor: origColor}, options.animateTime ) .mouseleave(function() { $thisSeat.stop(true,true).animate( { backgroundColor: origColor}, 0 ); }); // show the tool tip //Tip( se(seatDetails, seatNumber) ); Comments.createToolTip(seatDetails, seatNumber); } if (options.eventType == 'click') { // run the click function here alert("Click eventType not ready yet!!!"); } }); }, loadSeatmapData: function() { $.ajax({ url: options.ajaxURL, data: options.planeID, dataType: "json", success: function(seatmap) { Comments.showToolTip(seatmap); } }); } }// Comments //run it Comments.initToolTip(); }//SE_seat_comments })(jQuery);

SeatExpert.com

Ajax Load of External Content

Most of the time users do not want to see this legend, so we only load if the user asks for it.

	// load the seatexpert legend only when the user asks ( clicks )
	$.fn.se_ajax_legend = function(options) {
		// setup defaults for good practice
		var 
			defaults = {
				url : '/inc/legend.html',
				clickOn : '#show_legend',
				time : 100,
				loading : false,
				hiddenId : '#legend_data'
			},
			settings = $.extend({}, defaults, options);

			this.each(function() {
				//cache this
				var $this = $(this);
				var $clickOn = $(settings.clickOn);
				
				// hide the loading icon if we want one, not necesarry with small file to load
				if (settings.laoding) {
					$this.hide();
				}
				
				$clickOn.click(function(event){
					// check to see if we already showed this
					if ($this.is(":hidden")) {
						// check to see if we have loaded content already
						if ( !$(settings.hiddenId).length ) {
							// load the html from external file, 
							// we use .ajax() here instead of .load() to be ready for dynamic content
							$.ajax({
								url: settings.url,
								success: function(data) {
									// show the loaded ajax, then slide down
									$this.html(data).slideDown(settings.time);
								}
							});//end ajax
						} else {
							$this.slideDown(settings.time);
						} 
					} else {
						//slide up the legend
						$this.slideUp(settings.time);
					}
					
					event.preventDefault();
				
				});// end click()
			
			});//end this.each
	
		return this;
		
	}

SwimandSing.com

	
	/*
	Swimandsing.com functions
	Author: Jamie Broussard
	Author email: jamie@swimandsing.com
	Created: 20010-03-01
	Last Revision: 2010-03-25
	Description: 
		These are created as jQuery plugins.
		Most are works in progress.
	Credit due:
		Much of what is here comes from http://net.tutsplus.com/ 
		Thanks to mostly Jeffrey Way http://net.tutsplus.com/author/jeffreyway/
	*/
	
	//make jQuery plugins
	(function($){
		// simple tooltip
		// default usage: $('a').tooltip(); 
		// with options:
		// $('a').tooltip({background: "#000", color: "#fff", rounded: true });
		
		$.fn.JB_menu = function(options) {
			var 
				defaults = {
					hiddenMenu: 'ul',
				},
				settings = $.extend({}, defaults, options);
			
			this.each(function() {
				// cache this and at the same time make sure it children are hidden
				var $this = $(this).children('ul').hide().end();
	
				$this.hover(function() {
					// mouseover
					$(this).find('> ul').stop(true, true).slideDown('slow');
		 		}, function() {
		 			// mouseout
		 			$(this).find('> ul').stop(true, true).hide(); 		
				});
				
			});
			
			// returns the jQuery object to allow for chainability
			return this;
			
		} //end JB_menu
		
		$.fn.JB_info_box = function(options) {
			var 
				defaults = {
					infoBox: '',
					slideTime: 200
				},
				settings = $.extend({}, defaults, options);
				
			this.each(function() {
				// cache this - the anchor we hover over
				var $this = $(this);
				// mousover show the info box and hold
				
			
			});
			
		} // end JB_better_menu
			
		$.fn.JBtoolTip = function(options) {
			var 
				defaults = {
					background: '#e4e4e4',
					color: '#888',
					rounded: false
				},
				settings = $.extend({}, defaults, options);
				
			this.each(function() {
				var $this = $(this);
				var title = this.title;	
				
				if($this.is('a') && $this.attr('title') != '') {
				
					this.title = '';
					
					$this.hover(function(e) {
						// mouse over
						$('
') .appendTo('body') .text(title) .hide() .css({ backgroundColor: settings.background, color: settings.color, top: e.pageY + 10, left: e.pageX + 20 }) .fadeIn(350); if(settings.rounded) { $('#tooltip').addClass('rounded'); } } , function(){ // mouse out $('#tooltip').remove(); }); } $this.mousemove(function(e) { $('#tooltip').css({ top: e.pageY + 10, left: e.pageX + 20 }); }); }); // returns the jQuery object to allow for chainability return this; } //end toolTip // rotate children within a div // default usage: $('#feature').featureRotate(); // with options: // interval=[int], time=[int] both in milliseconds, src=[url] $.fn.JBfeatureRotate = function(options) { var defaults = { interval: 3000 , time: 250, src: null }, settings = $.extend({}, defaults, options); this.each(function() { var $this = $(this); var firstChild = $this.children(':first'); // check to see if the user wants an Ajax data load if (settings.src) { $.post(settings.src, function(data){ // append the ajax data then hid all but the first child $this.append(data).children(firstChild + ':not(:first)').hide(); }); } else { // hide all but the first child $this.children(firstChild + ':not(:first)').hide(); } setInterval(function() { $this.children(firstChild + ':visible').fadeOut(settings.time, function() { $(this).index() === $(this).parent().children().length -1 ? $(this).parent().children(firstChild).eq(0).fadeIn(settings.time) : $(this).next().fadeIn(settings.time); }); },settings.interval); }); // returns the jQuery object to allow for chainability return this; }// end featureRotate // initiallly hide content to be revieled by a mouse click // made for WordPress but should work for anything // usage $('#yourdiv').JB_hide_show_toggle({clickOn: 'a #yourclickon', time: 500, hideFirst: true}); $.fn.JB_hide_show_toggle = function(options) { // set defaults or use user settings var defaults = { clickOn : '#prior_click', time : 300, hideFirst : true, showTextToggle : true, openClickClass : 'open_arch', closeClickClass : 'close_arch', openClickText : '[+]', closeClickText : '[-]' }, settings = $.extend({}, defaults, options); this.each(function() { //cache this first var $this = $(this); // hide this first if we need to if (settings.hideFirst == true) { $this.hide(); if (settings.showTextToggle){ $(settings.clickOn).html(settings.openClickText).addClass(settings.openClickClass); } else { $(settings.clickOn).addClass(settings.openClickClass); } } else { $(settings.clickOn).html(settings.closeClickText).addClass(settings.closeClickClass); } // open and close this $(settings.clickOn).click(function (event) { if ($this.is(":hidden")) { $this.slideDown(settings.time); if (settings.showTextToggle){ $(settings.clickOn).html(settings.closeClickText).toggleClass(settings.openClickClass).toggleClass(settings.closeClickClass); } } else { $this.slideUp(settings.time); if (settings.showTextToggle){ $(settings.clickOn).html(settings.openClickText).toggleClass(settings.openClickClass).toggleClass(settings.closeClickClass); } } //$(settings.clickOn).toggleClass(settings.openClickClass).toggleClass(settings.closeClickClass); event.preventDefault(); }); });// end this.each // returns the jQuery object to allow for chainability return this; }// end BA_hide_show })(jQuery);