Super Plugin Sale! Your Choice: BOGO or 30% Off »
Web Dev + WordPress + Security
BBQ Pro: Block Bad Queries
BBQ Pro: The fastest firewall to protect your WordPress.

sIFR Notes Plus

Here are a few sIFR Notes for Perishable Press. Just what are we looking at here? Well, first it is important to understand the sIFR variables and the order in which they should appear:

(sSelector, sFlashSrc, sColor, sLinkColor, sHoverColor, sBgColor, nPaddingTop, nPaddingRight, nPaddingBottom, nPaddingLeft, sFlashVars, sCase, sWmode)

The variable, sFlashVars consists of the following sub-variables (these should be seperated with an & sign:

# Align Flash text block
textalign=center

# Moves text any number of pixels to the right
offsetLeft=3

# Moves text any number of pixels down
offsetTop=3

# Adds underline links when hovered
underline=true

Then, inducing from the following code example, we should place a similar set of statements at the bottom of any pages requiring sIFR functionality:

<script type="text/javascript">
<!--//--><![CDATA[//><!--

if(typeof sIFR == "function") {
   sIFR.replaceElement("h1", "http://domain.com/path/to/fonts/font1.swf", "#E1E1E1", "#FFFF99", "#CC6633", "#333333", 0, 0, 0, 0, null, null, "opaque");

   sIFR.replaceElement("h2", "http://domain.com/path/to/fonts/font2.swf", "#CC6633", "#FFFF99", "#CC6633", "#333333", 0, 0, 0, 0, null, null, "opaque");

   sIFR.replaceElement("h3", "http://domain.com/path/to/fonts/font3.swf", "#E1E1E1", "#FFFF99", "#CC6633", "#333333", 0, 0, 0, 0, null, null, "opaque");
}

//--><!]]>
</script>

Arguments may also be stated by name rather than sequentially:

<script type="text/javascript">
<!--//--><![CDATA[//><!--

if(typeof sIFR == "function") {
   sIFR.replaceElement("h1", named({sFlashSrc: "../path/to/font.swf", sColor: "#777", sCase: "upper"}));
};

//--><!]]>
</script>

Here is another example using the named arguments method:

<script type="text/javascript">
<!--//--><![CDATA[//><!--

if(typeof sIFR == "function") {
   sIFR.replaceElement(named({nWidth:333,nHeight:33,sSelector:"h3.class-h3", sFlashSrc:"http://domain.com/fonts/font.swf", sColor:"#333", sLinkColor:"#777", sBgColor:"#FFF", sHoverColor:"#DDD", sWmode: "transparent", nPaddingTop:0, nPaddingBottom:0}));

//--><!]]>
</script>

Finally, here is the default CSS supplied with sIFR:

/* sIFR Print CSS | Hide Flash headlines from the browser */

.sIFR-flash, .sIFR-flash object, .sIFR-flash embed {
	display: none !important;
	position: absolute;
	overflow: hidden;
	height: 0px;
	width: 0px;
}
span.sIFR-alternate {
	visibility: visible !important;
	position: static !important;
	display: block !important;
	left: auto !important;
	top: auto !important;
}

/* sIFR Screen CSS | These are standard sIFR styles -- do not modify */

.sIFR-flash { 
	visibility: visible !important; 
	margin: 0px; 
}
.sIFR-replaced { 
	visibility: visible !important;
}
span.sIFR-alternate { 
	top: 0px;
	left: 0px; 
	width: 0px; 
	height: 0px; 
	display: block; 
	overflow: hidden;
	position: absolute;
}

/* Decoy styles used to hide the browser text before it is replaced */

.sIFR-hasFlash h1 { 
	letter-spacing: -2px;
	visibility: visible;
	font-size: 32px;
	height: 40px;
}
.sIFR-hasFlash h3 { 
	visibility: visible;
	font-size: 18px;
}

Ahhh, the good ’ol days.

About the Author
Jeff Starr = Fullstack Developer. Book Author. Teacher. Human Being.
Blackhole Pro: Trap bad bots in a virtual black hole.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
The Tao of WordPress: Master the art of WordPress.
Thoughts
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Crazy that we’re almost halfway thru 2024.
I live right next door to the absolute loudest car in town. And the owner loves to drive it.
8G Firewall now out of beta testing, ready for use on production sites.
It's all about that ad revenue baby.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.