CFLib.org – Common Function Library Project

SuperSpacer([height][, width][, border][, srcURL][, alt])

Last updated September 30, 2005

author

Dave Forrest

Version: 1 | Requires: CF5 | Library: UtilityLib

Description:
This small function is used as a shortcut for adding transparent gif spacer images.

Return Values:
Returns a string.

Example:

<cfoutput>
#ss()# -- single spacer 1 x 1
#ss(4,4)# -- Spacer 4 x4
#ss(6,6,1)# -- Spacer 6 x 6 with 1px border
</cfoutput>

Parameters:

Name Description Required
height Height of spacer image. Defaults to 1. No
width Width of spacer image. Defaults to 1. No
border Border of spacer image. Defaults to 1. No
srcURL Source of image. Defaults to s.gif. No
alt Alt tag value. Defaults to an empty string. No

Full UDF Source:

/**
 * A UDF that will add a spacer gif image in a varity of formats to assist in page layout.
 * 
 * @param height      Height of spacer image. Defaults to 1. (Optional)
 * @param width      Width of spacer image. Defaults to 1. (Optional)
 * @param border      Border of spacer image. Defaults to 1. (Optional)
 * @param srcURL      Source of image. Defaults to s.gif. (Optional)
 * @param alt      Alt tag value. Defaults to an empty string. (Optional)
 * @return Returns a string. 
 * @author Dave Forrest (dmf67@yahoo.com) 
 * @version 1, September 30, 2005 
 */
function ss() {    
    var height    = 1;
    var width    = 1;
    var border    = 0;
    var srcURL    = "s.gif";
    var alt        = "";
    var outString = "";
    if(arrayLen(arguments) gte 1) height = arguments[1];
    if(arrayLen(arguments) gte 2) width  = arguments[2];
    if(arrayLen(arguments) gte 3) border = arguments[3];
    if(arrayLen(arguments) gte 4) srcURL = arguments[4];
    if(arrayLen(arguments) gte 5) alt    = arguments[5];
    outString = "<img src=""#srcURL#"" height=""#height#"" width=""#width#"" alt=""#alt#"" border=""#border#"">";
    return outString;
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson