forked from SamWM/jQuery-Plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing plugin. README listing plugins available
- Loading branch information
SamWM
committed
Dec 12, 2009
1 parent
3114c26
commit 95839f8
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Plugins for jQuery: | ||
|
||
checkbox manipulation - working with checkboxes | ||
fix Q tags - wrap q tags with proper quotes in Internet Explorer | ||
focus fields - add an outline and background to text inputs when they are given focus | ||
jQIR - replace text with images | ||
newsticker - a news ticker for sequentially showing each item in a list | ||
numeric - allow only numbers to be typed into a text box | ||
preload images - preload any images that you may use in the future (e.g. for image rollovers) | ||
select box manipulation - add/remove options in select boxes as well as sort them | ||
time picker - display a list of times when you click on an input |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function fixQTags() | ||
{ | ||
if($.browser.msie) | ||
{ | ||
$("q").prepend("“").append("”"); | ||
} | ||
} | ||
// execute fixQTags when page is ready | ||
$(fixQTags); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* | ||
* Copyright (c) 2006/2007 Sam Collett (http://www.texotela.co.uk) | ||
* Licensed under the MIT License: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
* | ||
*/ | ||
|
||
|
||
/* | ||
* jQuery Image Replacement. An alternative to using CSS hacks | ||
* The id attribute (or class) is used for the filename | ||
* | ||
* @name jQIR | ||
* @param String format Image format/file extension (e.g. png, gif, jpg) - ignored if specifying the filename in the class | ||
* @param String path (optional) Path to images folder | ||
* @param Function onload (optional) Function to run when image has loaded | ||
* @author Sam Collett (http://www.texotela.co.uk) | ||
* @example $(".jqir").jQIR("png", "images/"); | ||
* @before <h1 id="heading1" class="jqir">Heading 1</h1> | ||
* <h2 class="jqir {src:heading2.png}">Heading 2</h2> | ||
* @result <h1 id="heading1" class="jqir"><img alt="Heading 1" src="images/heading1.png"></h1> | ||
* <h2 class="jqir {src:heading2.png}"><img alt="Heading 2" src="images/heading2.png"></h2> | ||
* @example $(".jqir").jQIR("gif"); // use same folder as page | ||
* @before <h1 id="heading1" class="jqir">Heading 1</h1> | ||
* @result <h1 id="heading1" class="jqir"><img alt="Heading 1" src="heading1.gif"></h1> | ||
* | ||
*/ | ||
jQuery.fn.jQIR = function(format, path, onload) | ||
{ | ||
if(!document.images) return this; | ||
path = path || ""; | ||
this.each( | ||
function() | ||
{ | ||
var img = $("<img>"), el = jQuery(this); | ||
var file; | ||
var re = /(?:{src\:)(\S+)(?:})/i; | ||
var m = this.className.match(re); | ||
if(m) | ||
{ | ||
file = path + m[1]; | ||
} | ||
else | ||
{ | ||
file = path + this.id + "." + format; | ||
} | ||
|
||
jQuery(img).attr( | ||
{ | ||
src: file, | ||
alt: el.text() | ||
}).load(typeof onload == "function" ? onload : function(){} ); | ||
var a = el.find("a"); | ||
var toAppend = a.length ? a.empty().append(img) : img; | ||
el.empty().append(toAppend); | ||
} | ||
) | ||
return this; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
jQuery.preloadImages = function() | ||
{ | ||
for(var i = 0; i<arguments.length; i++) | ||
{ | ||
jQuery("<img>").attr("src", arguments[i]); | ||
} | ||
} |