<?xml version="1.0" encoding="ISO-8859-1"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Dynamic Drive Forums - Blogs - jscheuer1</title>
		<link>http://www.dynamicdrive.com/forums/blog.php?2033-jscheuer1</link>
		<description>Dynamic Drive help forum</description>
		<language>en</language>
		<lastBuildDate>Sun, 19 May 2013 04:30:19 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>10</ttl>
		<image>
			<url>http://www.dynamicdrive.com/forums/images/misc/rss.jpg</url>
			<title>Dynamic Drive Forums - Blogs - jscheuer1</title>
			<link>http://www.dynamicdrive.com/forums/blog.php?2033-jscheuer1</link>
		</image>
		<item>
			<title>FaceScroll - my take</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?264-FaceScroll-my-take</link>
			<pubDate>Sat, 13 Oct 2012 20:32:39 GMT</pubDate>
			<description><![CDATA[Adds altScrollTo method to scroll to coordinates, element, or keyword position in the scroller. Adds optional callback for real time updates of the scroller's position. Fixes behavior of bi-directional scrollers in IE 8 and less. Now compatible to and including IE 6. Adds automatic console logging...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Adds altScrollTo method to scroll to coordinates, element, or keyword position in the scroller. Adds optional callback for real time updates of the scroller's position. Fixes behavior of bi-directional scrollers in IE 8 and less. Now compatible to and including IE 6. Adds automatic console logging of missing helper scripts in browsers with console logging. Instates selector element return value for normal jQuery chaining of methods. Alters the mouseout behavior for default style scrollers to avoid jumpiness when still dragging a scrollbar.<br />
<br />
Applies to:<br />
<br />
<a href="http://www.dynamicdrive.com/dynamicindex11/facescroll/index.htm" target="_blank">FaceScroll Custom scrollbar</a><br />
<br />
This is a dropin replacement for FaceScroll Custom scrollbar that enables an altScrollTo method for scrolling to any given point within a scroller via top and/or horizontal coordinates, or via an element with an id within a scroller, or via the keywords 'begin', 'middle', or 'end' to scroll to those positions respectively.<br />
<br />
It also adds an option for real time updates of the scroller's postion for use as you see fit.<br />
<br />
It corrects the scroller's behavior in IE 8 and less down to and including IE 6, especially IE 7 and 6 which were previously excluded form this script. IE 8 only had problems with bi-directional scrollers. And adds the previously missing common jQuery object return value for its primary function so that it may be chained from in the normal manner that users of jQuery are accustomed to.<br />
<br />
For non-touch screen browsers it changes the behavior for default style scrollers, the ones where the scrollbars are hidden on mouseout. If the user is still dragging the scrollbar on mouseout, it will remain visible and functional until the mouseup event that releases it. In the original version it would disappear and the scroller could jump or do other odd things depending upon the browser.<br />
<br />
Demo:<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/facescroll/demo-2.htm" target="_blank">http://home.comcast.net/~jscheuer1/s...oll/demo-2.htm</a><br />
<br />
You may use your browser's view source to see the syntax used in the demo, which is the same as the original, just with the added option and function.<br />
<br />
Script (right click and 'Save As', requires the same helper scripts as does the original version):<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/facescroll/facescroll.js" target="_blank">http://home.comcast.net/~jscheuer1/s.../facescroll.js</a><br />
<br />
From the release notes in the updated script:<br />
<br />
&quot;Allows for an optional scrolldatato(data) function that returns the scroll<br />
position in real time vertically and horizontally of that scroller's content. It's data argument returns<br />
an object with that faceScroll scroller's top and left positions as negative floating point numbers.<br />
Example syntax for using scrolldatato(data) which is used as an option during initialization:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:84px;">	$('#demo1').alternateScroll({'scrolldatato': function(data){
			$('#dat-top').val(Math.abs(Math.round(data.top)));
			$('#dat-left').val(Math.abs(Math.round(data.left)));
		}
	});</pre>
</div>The above example will populate the text inputs with id's of 'dat-top' and 'dat-left' with the $('#demo1')<br />
FaceScroll scroller's top and left scroll positions respectively. These will be updated in real time as<br />
the scroller scrolls. Using the Math.abs and Math.round methods will translate the negative floating<br />
point values to positive whole integers.<br />
<br />
Adds an an altScrollTo() function as a jQuery method to scroll vertically<br />
and/or horizontally to a positive integer pixel destination or to a jQuery selector of an element within<br />
the content. The altScrollTo() function returns its selector object and the alternateScroll() function<br />
now does so too. These are in accordance with jQuery convention to allow for chaining.<br />
The available syntaxes for altScrollTo() are:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:252px;">	$('#selector').altScrollTo(80); // will scroll the FaceScroll scroller initialized on $('#selector')
		// to 80 pixels vertical, unless the scroller only scrolls horizontally, in which case it will
		// scroll to 80 pixels horizontal.

	$('#selector').altScrollTo(80, 50); // will scroll the FaceScroll scroller initialized on $('#selector')
		// to 80 pixels vertical, 50 pixels horizontal, unless that scroller scrolls only horizontally,
		// in which case it will only scroll to 50 pixels horizontal, or unless that scroller only scrolls
		// vertically, in which case it will only scroll to 80 pixels vertical.

	$('#selector').altScrollTo('#selector2'); // will scroll the FaceScroll scroller initialized on $('#selector')
		// to the element within it with the id of 'selector2'.

	$('#selector2').altScrollTo(); // a shortcut method for $('#selector').altScrollTo('#selector2'); will scroll
		// the FaceScroll scroller that contains the element that has the id of 'selector2' to that element.
		// Be careful here, if two scrollers contain the same selector, unexpected results may occur.

	$('#selector').altScrollTo('end'); // will scroll the FaceScroll scroller initialized on $('#selector')
		// to the end both vertically and horizontally, or only one or the other if that scroller only
		// scrolls in that one direction. Other available keywords are 'middle', and 'begin'.</pre>
</div>If as can be done, multiple scrollers were initialized under one selector, one may use either a selector<br />
for the specific scroller one wants to scroll, or the shortcut method which will find the scroller that<br />
contains that id selector in it's content.<br />
<br />
For non-touch screens improves behavior on mouseout while still scrolling a Facescroll element with 'hide-bars': true&quot;<br />
<br />
<br />
Comments are welcome but will be moderated until approved.<br />
<br />
If you want help with this though, please post a new thread in the Dynamic Drive Scripts help section. Link to this blog entry in your post.</blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?264-FaceScroll-my-take</guid>
		</item>
		<item>
			<title>Crawler Interim Updates</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?260-Crawler-Interim-Updates</link>
			<pubDate>Mon, 08 Oct 2012 15:39:28 GMT</pubDate>
			<description><![CDATA[Adds: persistence option, oncontentinit option, auto detect of a single table with a single row for optionally randomizing its td's, code efficiencies. 
 
Applies to: 
 
Text and Image Crawler v1.5 (http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm) 
 
What many people don't know about...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Adds: persistence option, oncontentinit option, auto detect of a single table with a single row for optionally randomizing its td's, code efficiencies.<br />
<br />
Applies to:<br />
<br />
<a href="http://www.dynamicdrive.com/dynamicindex2/crawler/index.htm" target="_blank">Text and Image Crawler v1.5</a><br />
<br />
What many people don't know about Crawler is that it makes a duplicate train of its text and/or images so that they may be looped/viewed in a continuous manner without spaces or jumpiness.<br />
<br />
That's fine as long as you're not trying to initialize that content to another script like a lightbox.<br />
<br />
Some people have expressed a desire to have Crawler remember (persist) its state (position and direction) when refreshed and when the same Crawler is on different pages.<br />
<br />
This is a drop-in replacement for the current version 1.5 crawler.js file. It adds the ability to run a callback function once the crawler divisions have been populated and made a part of the DOM. Example:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:348px;">marqueeInit({
	uniqueid: 'mycrawler2',
	style: {
		'padding': '2px',
		'width': '700px',
		'height': '240px'
		
	},
	inc: 20, //speed - pixel increment for each iteration of this marquee's movement
	mouse: 'cursor driven', //mouseover behavior ('pause' 'cursor driven' or false)
	moveatleast: 3,
	neutral: 150,
	savedirection: true,
	random: false<code style="background-color: #FFFFBB">,
	initcontent: function(contentarray){
		var $ = jQuery;
		if(typeof $ !== 'undefined' &amp;&amp; typeof $.fn.fancybox === 'function'){
			$(contentarray[1]).find('a[rel=example_group]').attr('rel', 'example_group2');
			$(&quot;a[rel^=example_group]&quot;).fancybox({
				'titlePosition' 	: 'over',
				'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
					return '&lt;span id=&quot;fancybox-title-over&quot;&gt;Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &amp;nbsp; ' + title : '') + '&lt;/span&gt;';
				}
			});
		}
	}</code>
});</pre>
</div>The contentarray contains two items, contentarray[0] and contentarray[1], which each contain one of the now two trains of images and/or text of the Crawler as HTML code on the page. One or both of these may be used to initialize that content to another script. The keyword <b>this</b> (not used in the above example) would refer to the Crawler instance.<br />
<br />
<br />
Persistence is easy to add. Example:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:192px;">marqueeInit({
 uniqueid: 'art',
 direction: 'right',
 style: { //style object for this marquee container (use quotes on both sides of the : as shown)
	'width': '60%',
	'height': '235px',
	'background-color': '#ddd',
	'border': '1px solid #111',
	'margin': '2ex auto 0 auto'},
 inc: 6, //speed - pixel increment for each iteration of this marquee's movement
 moveatleast: 4,
<code style="background-color: #FFFFBB"> persist: true,</code>
 mouse: 'cursor driven' //mouseover behavior ('pause' 'cursor driven' or false)
});</pre>
</div>Here's the updated script (right click and 'Save As'):<br />
<br />
<a href="http://www.dynamicdrive.com/forums/attachment.php?attachmentid=4799&amp;d=1349777832"  title="Name:  crawler.js
Views: 247
Size:  13.9 KB">crawler.js</a><br />
<br />
It also enhances the script's ability to run in Quirks Mode in IE. And if you choose to make your Crawler's content a single table with a single row, and choose the random option, it will randomize the td's.<br />
<br />
Comments are welcome, but will be held back until I determine they're not spam.<br />
<br />
If you want help with this code, please post a new thread in the Dynamic Drive Scripts Help section:<br />
<br />
<a href="http://www.dynamicdrive.com/forums/forumdisplay.php?2-Dynamic-Drive-scripts-help" target="_blank">http://www.dynamicdrive.com/forums/f...e-scripts-help</a><br />
<br />
and post a link to this Blog entry in your message. Use the word Crawler in your title.<br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>Oct/9/12 added auto detect table, code efficiencies, details and updated attached script.</i></div></blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?260-Crawler-Interim-Updates</guid>
		</item>
		<item>
			<title>BG Carousel Links</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?259-BG-Carousel-Links</link>
			<pubDate>Tue, 24 Jul 2012 03:12:34 GMT</pubDate>
			<description>I found a fairly easy way to add optional links to the Dynamic Drive Script: 
 
Background Image Carousel (http://www.dynamicdrive.com/dynamicindex14/bgcarousel.htm) 
 
First a demo: 
 
BG Carousel Links - Demo (http://home.comcast.net/~jscheuer1/side/bgcarousel/demo_linked.htm) 
 
Now, how to:</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I found a fairly easy way to add optional links to the Dynamic Drive Script:<br />
<br />
<a href="http://www.dynamicdrive.com/dynamicindex14/bgcarousel.htm" target="_blank">Background Image Carousel</a><br />
<br />
First a demo:<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/bgcarousel/demo_linked.htm" target="_blank">BG Carousel Links - Demo</a><br />
<br />
Now, how to:<br />
<br />
Using a text only editor like NotePad, add this highlighted style as shown to the bottom of the on page styles (modified from <b>Step 1</b> on the demo page):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:276px;"> . . . ctedslide div.desc{ /* CSS for currently selected slide's desc div */
}

div.slide div.desc h2{
font-size:150%;
margin:0;
}

div.slide div.desc a{
color:yellow;
text-decoration:none;
}

<code style="background-color: #FFFFBB">div.slide a.linkinbgcaroulsel { /* CSS Styles for whole image links */
	display: block;
	width: 100%;
	height: 100%;
	position: absolute;
	text-decoration: none;
}</code>
&lt;/style&gt;</pre>
</div>Use this updated version of the script (right click and 'Save as'):<br />
<br />
<a href="http://www.dynamicdrive.com/forums/attachment.php?attachmentid=4680&amp;d=1343175333"  title="Name:  bgcarousel.js
Views: 407
Size:  8.8 KB">bgcarousel.js</a><br />
<br />
Which also includes bug fixes:<br />
<br />
<ul><li style="">for all browsers where after the cycles played out, manual navigation would result in two slides per click<br />
<br /></li><li style="">for Opera where the controls wouldn't always function</li></ul><br />
<br />
Now you can optionally add actual link tags to the on page <code style="background-color: #FFFFBB">new bgCarousel()</code> call. Example (also modified from <b>Step 1</b> on the demo page, additions highlighted):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:204px;">var firstbgcarousel=new bgCarousel({
	wrapperid: 'mybgcarousel', //ID of blank DIV on page to house carousel
	imagearray: [ //[&quot;image_path&quot;, &quot;optional description&quot;<code style="background-color: #FFFFBB">, &quot;optional link tag&quot;</code>]
		['autumnpark.jpg', '&lt;h2&gt;Autumn Day&lt;/h2&gt;The sun peaks through the trees, a knife that cuts through the chill, crisp air.'],
		['chime.jpg', ''<code style="background-color: #FFFFBB">, '&lt;a target=&quot;_blank&quot; href=&quot;http://www.dynamicdrive.com/&quot;&gt;&lt;/a&gt;'</code>],
		['girlportrait.jpg', 'The scent of spring invigorates her as she inhales whilst the warm breeze brings a wave of tranquility.'],
		['redbench.jpg', 'Alone and Lonliness- Peaceand Inner Struggle'<code style="background-color: #FFFFBB">, '&lt;a href=&quot;http://www.google.com/&quot;&gt;&lt;/a&gt;'</code>] //&lt;--no trailing comma after very last image element!
	],
	displaymode: {type:'auto', pause:3000, cycles:2, stoponclick:false, pauseonmouseover:true},
	navbuttons: ['left.gif', 'right.gif', 'up.gif', 'down.gif'], // path to nav images
	activeslideclass: 'selectedslide', // CSS class that gets added to currently shown DIV slide
	orientation: 'h', //Valid values: &quot;h&quot; or &quot;v&quot;
	persist: true, //remember last viewed slide and recall within same session?
	slideduration: 500 //transition duration (milliseconds)
});</pre>
</div>You can still have descriptions and/or links in the descriptions if you like.<br />
<br />
<br />
Comments are welcome, but I will hold them back pending the determination that they're not spam.<br />
<br />
If you want help on this, please post a thread in the:<br />
<br />
<a href="http://www.dynamicdrive.com/forums/forumdisplay.php?f=2" target="_blank">Dynamic Drive scripts help</a><br />
<br />
section and include the words:<br />
<br />
<font color="Blue">BgCarousel and Links</font><br />
<br />
in the title of your thread. It would help to also include a link to this blog posting and to your page. And of course describe the problem you  are having.</blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?259-BG-Carousel-Links</guid>
		</item>
		<item>
			<title>Version 5 Events</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?255-Version-5-Events</link>
			<pubDate>Thu, 05 Apr 2012 05:12:50 GMT</pubDate>
			<description><![CDATA[In javascript there are basically two types of events that can be assigned to elements and objects. I classify them as version 4 events (those that were available in Netscape 4 and IE 4), and version 5 events, those that became available starting with IE 5 and presumably NS 5, but the earliest I'm...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">In javascript there are basically two types of events that can be assigned to elements and objects. I classify them as version 4 events (those that were available in Netscape 4 and IE 4), and version 5 events, those that became available starting with IE 5 and presumably NS 5, but the earliest I'm aware of them in NS was NS 6 (I don't recall ever seeing a NS 5 browser).<br />
<br />
Version 4 events are still available in today's browsers and are usually the first ones folks learn about, examples:<br />
<br />
<ol class="decimal"><li style=""><div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">&lt;a href=&quot;somepage.htm&quot; onclick=&quot;alert(this.href);&quot;&gt;Some Page&lt;/a&gt;</pre>
</div></li><li style=""><div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;">&lt;a id=&quot;myid&quot; href=&quot;somepage.htm&quot;&gt;Some Page&lt;/a&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
document.getElementById('myid').onclick = function(){alert(this.href);};
&lt;/script&gt;</pre>
</div></li></ol><br />
<br />
These both have the same effect. When one clicks on the link it will alert its href and then switch to the somepage.htm page. If we want them to stay on the current page and not switch, we can add a return false:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;">&lt;a id=&quot;myid&quot; href=&quot;somepage.htm&quot;&gt;Some Page&lt;/a&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
document.getElementById('myid').onclick = function(){alert(thiis.href);<code style="background-color: #FFFFBB"> return false;</code>};
&lt;/script&gt;</pre>
</div>Here's an example of the same thing as a version 5 event:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;">&lt;a id=&quot;myid&quot; href=&quot;somepage.htm&quot;&gt;Some Page&lt;/a&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
document.getElementById('myid').addEventListener('click', function(e){alert(this.href);<code style="background-color: #FFFFBB"> e.preventDefault();</code>}, false);
&lt;/script&gt;</pre>
</div>It's also know as the standard event model and e in this case represents the event. Instead of return false, we prevent the event's default as shown.<br />
<br />
It works in all currently used browsers except for IE 8 and less, which use a different syntax that uses a a global event object called event and doesn't use a function to set the return action and doesn't pass the element to its function as 'this'. It can be made to do that though via the use of call(), and we can use its event's returnValue property to set the return. so adding that to what we already had:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:216px;">&lt;a id=&quot;myid&quot; href=&quot;somepage.htm&quot;&gt;Some Page&lt;/a&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var el = document.getElementById('myid');
function myclick(e){
	e = e || event;
	alert(this.href);
	if(e.preventDefault){e.preventDefault();}
	e.returnValue = false;
}
if (el.addEventListener){
	el.addEventListener('click', myclick, false);
}
else if (el.attachEvent){
	el.attachEvent('onclick', function(){myclick.call(el);});
}
&lt;/script&gt;</pre>
</div>An advantage of doing it this way is that even if the element already had an onclick (whether version 4 or 5), this will be added to it instead of overwriting it. And even if another script comes along later and adds a version 4 event to it, ours will still be there. Because of that most advanced scripts use it so as not to interfere with or be interfered with by any events already assigned on the page. It's particularly helpful when adding an onload or load event to the page, it won't interfere with any existing ones for the page.<br />
<br />
A disadvantage is that we cannot read the event. With a version 4 event we could do:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">alert(document.getElementById('myid').onclick);</pre>
</div>and it would tell us the event, like for #1 or #2 at the beginning of this article, it would say:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				function click(){alert(this.href);}
			
		</div>
	</div>
</div>But our version 5 edition of that same event will alert null or perhaps some other falsey value like undefined or nothing at all. The only information we can glean from it is if we add and/or attach another click event to it. Then during the execution of the added event we can query whether or not it has been defaultPrevented or has a returnValue of false.<br />
<br />
With the standard event model this is simple:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">el.addEventListener('click', function(e){alert(e.defaultPrevented);}, false);</pre>
</div>But with IE less than 9 we need to:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">el.attachEvent('onclick', function(){alert(event.returnValue);});</pre>
</div>To make matters more complicated, in the standard event model we simply have to add this new event after the one we want to know about. However, in IE less than 9 we must add it before, as the events in IE less than 9 get executed in reverse order to that in which they were assigned. (The documentation says it's a random order, but in my experience it's simply 'last in first out', at least in most cases). So we can do:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:240px;">&lt;a id=&quot;myid&quot; href=&quot;somepage.htm&quot;&gt;Some Page&lt;/a&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var el = document.getElementById('myid');
function myclick(e){
	e = e || event;
	alert(this.href);
	if(e.preventDefault){e.preventDefault();}
	e.returnValue = false;
}
if (el.addEventListener){
	el.addEventListener('click', myclick, false);
<code style="background-color: #FFFFBB">	el.addEventListener('click', function(e){alert(e.defaultPrevented);}, false);</code>
}
else if (el.attachEvent){
<code style="background-color: #FFFFBB">	el.attachEvent('onclick', function(){alert(event.returnValue);});</code>
	el.attachEvent('onclick', function(){myclick.call(el);});
}
&lt;/script&gt;</pre>
</div>This is all good information to have, especially when you're working in an environment with other scripts.<br />
<br />
It should also be noted that script libraries like jQuery, Prototype, Dojo, and others generally assign events in this way. So unless an author using one of those libraries specifies a version 4 syntax when assigning events, they will be assigned as version 5 events.</blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?255-Version-5-Events</guid>
		</item>
		<item>
			<title>Extra Buttons for Ultimate Fade-in slideshow</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?248-Extra-Buttons-for-Ultimate-Fade-in-slideshow</link>
			<pubDate>Tue, 30 Aug 2011 20:52:50 GMT</pubDate>
			<description>The product of many requests as regards Ultimate Fade-in slide show (http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm) (currently at v2.4, but should work for any Ultimate Fade-in slideshow in the 2.x series) for a button to do this or that, stop or go, pause/play, and individual...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">The product of many requests as regards <a href="http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm" target="_blank">Ultimate Fade-in slide show</a> (currently at v2.4, but should work for any Ultimate Fade-in slideshow in the 2.x series) for a button to do this or that, stop or go, pause/play, and individual numbered or thumbnail buttons with or without special effects, with onclick or onmouseover for these individual buttons. This script (right click and 'save as'):<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/inmotion/js/extrabuttons.js" target="_blank">extrabuttons.js</a><br />
<br />
can do any or virtually all (some things you wouldn't want to combine in one slideshow) of these things. In fact, I combined more than anyone would probably want for the second demo:<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/inmotion/garden.htm" target="_blank">Demo_1</a> - garden<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/inmotion/button_ctrl_auto.htm" target="_blank">Demo_2</a> - enhanced default show from script's demo page<br />
<br />
To set it up on your page, download the extrabuttons.js script (see above), and add it's tag (highlighted) between fadeslideshow.js and the on page portion of the script (from the second demo):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:372px;">&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;fadeslideshow.js&quot;&gt;
/***********************************************
* Ultimate Fade In Slideshow v2.0- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for this script and 100s more
***********************************************/
&lt;/script&gt;
<code style="background-color: #FFFFBB">&lt;script type=&quot;text/javascript&quot; src=&quot;extrabuttons.js&quot;&gt;
// Extra Buttons Script (c)2011 John Davenport Scheuer
// as first seen in http://www.dynamicdrive.com/forums/
// add on for Ultimate Fade In Slideshow
// username: jscheuer1 - This Notice Must Remain for Legal Use
&lt;/script&gt;</code>
&lt;script type=&quot;text/javascript&quot;&gt;
var mygallery=new fadeSlideShow({
	wrapperid: &quot;fadeshow1&quot;, //ID of blank DIV on page to house Slideshow
	dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		[&quot;http://i26.tinypic.com/11l7ls0.jpg&quot;, &quot;&quot;, &quot;&quot;, &quot;Nothing beats relaxing next to the pool when the weather is hot.&quot;],
		[&quot;http://i29.tinypic.com/xp3hns.jpg&quot;, &quot;http://en.wikipedia.org/wiki/Cave&quot;, &quot;_new&quot;, &quot;Some day I'd like to explore these caves!&quot;],
		[&quot;http://i30.tinypic.com/531q3n.jpg&quot;],
		[&quot;http://i31.tinypic.com/119w28m.jpg&quot;, &quot;&quot;, &quot;&quot;, &quot;What a beautiful scene with everything changing colors.&quot;] //&lt;--no trailing comma after very last image element!
	],
	displaymode: {type:'manual', pause:2500, cycles:0, wraparound:true},
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	descreveal: &quot;ondemand&quot;,
<code style="background-color: #FFFFBB">	<b>extrabuttons</b>: {pause: 6000, pauseplay: true, pend: '.bob', nextprevresume: false, navfade: 0.65},
	<b>navbut</b>: '&lt;a href=&quot;javascript<b></b>:void(#%i)&quot;&gt;&lt;img src=&quot;images/buts/%c.gif&quot; alt=&quot;%c&quot; title=&quot;%c&quot; /&gt;&lt;/a&gt;',
	<b>onpauseplayswitch</b>: function(pauseplaybuts){
        	var ppstatus = this.setting.$togglerdiv.find('.pauseplaystatus');
		if(pauseplaybuts.hasClass('running')){
			ppstatus.html('running');
		} else {
			ppstatus.html('paused');
		}
	},</code>
	togglerid: &quot;fadeshow1toggler&quot;
});
&lt;/script&gt;</pre>
</div>Configure some options (some examples highlighted in the above) and/or add some markup to the toggler division and you're all set.<br />
<br />
To see the full source code of either demo, use your browser's 'view source'.<br />
<br />
Here's usage instructions for the options and markup that can be used. It also describes two new callback functions and other features that may be utilized:<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/inmotion/extrabuttons_usage.htm" target="_blank">Extra Buttons Usage</a><br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>Sept 4 2011 - add second demo, update script and usage instructions with extrabuttons.navbutonly property/option. Updated the version of fadeslideshow.js to one that actually uses the loading image. Preloaded the loading image on the demo pages. Updated fadeslideshow.js script available here (this may be updated further as the need arises - none of the changes are required for extrabuttons to work, they're just unofficial bug fixes):<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/inmotion/js/fadeslideshow.js" target="_blank">fadeslideshow.js</a><br />
</i></div><br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>Sept 9 2011 - update extrabuttons.js to run the onpauseplayswitch function (if valid and present) on init, remove hard coded value pause/play status from demos to better demonstrate use of this new code, change order of demos in this blog posting, label demos</i></div><br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>Oct 27 2011 - update fadeslideshow.js for more bug fixes see bottom of:<br />
<br />
<a href="http://www.dynamicdrive.com/forums/showpost.php?p=260188&amp;postcount=1" target="_blank">http://www.dynamicdrive.com/forums/s...88&amp;postcount=1</a><br />
<br />
for more info. One spelling error corrected.</i></div><br />
<br />
Comments are welcome but will be held back until I have a chance to check them for spam or requests for help. If you want help with this, please post in the forum and refer back to this blog entry. Use a title for your post that includes the word ExtraButtons.<br />
<br />
I'm working on more demos, as they evolve, they will be posted here, and the extrabuttons.js script and usage details linked to above may be updated. Notes will be made to that effect.</blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?248-Extra-Buttons-for-Ultimate-Fade-in-slideshow</guid>
		</item>
		<item>
			<title>Lightbox Bad, SlimBox Good</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?247-Lightbox-Bad-SlimBox-Good</link>
			<pubDate>Tue, 09 Aug 2011 15:55:14 GMT</pubDate>
			<description>The title overstates the point. Both these scripts in their latest versions are pretty darn good as are many of the other Lightbox type scripts out there (see end for two others or Google Lightbox for more, though not all are as good as those mentioned here, many including the original Lightbox...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">The title overstates the point. Both these scripts in their latest versions are pretty darn good as are many of the other Lightbox type scripts out there (see end for two others or Google Lightbox for more, though not all are as good as those mentioned here, many including the original Lightbox mentioned in the title of this blog entry are).<br />
<br />
<b>Here's the real story</b> -<br />
<br />
Some time ago <a href="http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm" target="_blank">Dynamic Drive's Lightbox</a> by Lokesh Dhakar was added to the Dynamic Drive official scripts. It uses the Prototype/Scriptaculous script libraries.<br />
<br />
However, since then so many of the scripts on Dynamic Drive now use the jQuery script library. And more are being converted over to it. Lightbox can be made to work on pages with jQuery based scripts, but it's often difficult. It can require updates to Lightbox, and is finicky even when it does not.<br />
<br />
Slimbox2:<br />
<br />
<a href="http://www.digitalia.be/software/slimbox2" target="_blank">http://www.digitalia.be/software/slimbox2</a><br />
<br />
does almost everything the Lightbox version from Dynamic Drive does, and it's based on jQuery so it's better for use on pages already using the jQuery library. The only thing it doesn't have is the linked title option added to the DD version by Dynamic Drive, and that may be added easily to Slimbox2.<br />
<br />
When using only jQuery based scripts on a page, it greatly cuts down on potential conflicts and also saves time and bandwidth for the page. Just be sure to use only one version of jQuery on the page. Ideally, and in most cases you only need one external script tag for it for the entire page, placed before all the other scripts that use jQuery.<br />
<br />
For even more flexibility with Slimbox2, surpassing even the latest Lightbox version (Lightbox 2.05 at this writing), you may use your own code block for loading, replacing its native &quot;AUTOLOAD CODE BLOCK&quot;.<br />
<br />
Here's one that gives Slimbox2 a few new powers:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:336px;">// Live invocation for use with other scripts, image maps, AJAX, etc. - also skips duplicates when forming groups
// Uses the rev attribute of the tag for a caption, freeing up the title for other uses or to be blank.
// Remove the AUTOLOAD CODE BLOCK if using this, or replace it with this code.
// Live Load Script (c)2011 John Davenport Scheuer - for use with Slimbox 2.04
// as first seen in http://www.dynamicdrive.com/forums/
// username: jscheuer1 - This Notice Must Remain for Legal Use
(function($){
	if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
		$('*[href][rel^=lightbox]').live('click', function(e){
			var t = this, rel = t.getAttribute('rel'), hrefs = [], links = [], index;
			if(rel === 'lightbox'){
				$.slimbox(t.href, t.getAttribute('rev') || '', { /* Options */ });
			} else {
				$('*[href][rel=&quot;' + rel + '&quot;]').each(function(){
					if($.inArray(this.href, hrefs) &lt; 0){
						if(t.href === this.href){index = hrefs.length;}
						hrefs.push(this.href);
						links.push([this.href, this.getAttribute('rev') || '']);
					}
				});
				<code style="background-color: #FFFFBB">$.slimbox(links, index, {loop: <font color="Red">true</font> /* , Aditional Options */ });</code>
			}
			e.preventDefault();
		});
	}
})(jQuery);</pre>
</div><ul><li style="">It will work on rel=&quot;lightbox&quot; and rel=&quot;lightbox[groupname]&quot; links, even if they are imported to the page after page load. This makes it good with AJAX and with scripts that change the DOM after it's loaded.<br />
<br /></li><li style="">It uses the rev attribute of the link for the title/caption, so complex HTML may be used without unsightly tool tips appearing on hover of the lightbox link, ex:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<pre class="bbcode_code" style="height:3*12px};"><span style="color:#008000">&lt;a href=<span style="color:#0000FF">&quot;some.jpg&quot;</span> rel=<span style="color:#0000FF">&quot;lightbox&quot;</span> rev=<span style="color:#0000FF">&quot;my caption&quot;</span>&gt;</span>Whatever<span style="color:#008000">&lt;/a&gt;</span></pre>
</div></li><li style="">It also, when the rel=&quot;lightbox[groupname]&quot; syntax is used, allows for looping back to the beginning from the end and visa versa. This may be turned off by setting the red true in the above to false.<br />
<br /></li><li style="">It effectively removes duplicate images from groups by never including them in the first place. Lightbox is supposed to do this, but stopped working in that regard a few versions back.</li></ul><br />
<br />
If you want even more flexibility and know jQuery, you can come up with your own code blocks for loading Slimbox2, or use something like <a href="http://colorpowered.com/colorbox/" target="_blank">ColorBox</a> or <a href="http://fancybox.net/" target="_blank">FancyBox</a> which have the ability to show other types of content, from the page or external on site pages, even from around the web. And they're also jQuery based.<br />
<br />
Comments are welcome but will be held back until I have a chance to check them for spam or requests for help. If you want help with this, please post in the forum and refer back to this blog entry. Use a title for your post that includes the word Slimbox or Lightbox.</blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?247-Lightbox-Bad-SlimBox-Good</guid>
		</item>
		<item>
			<title>Sticky Tooltip script Unofficial Update</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?48-Sticky-Tooltip-script-Unofficial-Update</link>
			<pubDate>Tue, 09 Nov 2010 16:49:41 GMT</pubDate>
			<description><![CDATA[The Sticky Tooltip script (http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm) has some room for updating as I've outlined here: 
 
Sticky Tooltip script - not sticky (http://www.dynamicdrive.com/forums/showthread.php?t=58709) 
 
and here: 
 
Sticky Tooltip script - no dock in IE 7- for...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore"><a href="http://www.dynamicdrive.com/dynamicindex5/stickytooltip.htm" target="_blank">The Sticky Tooltip script</a> has some room for updating as I've outlined here:<br />
<br />
<a href="http://www.dynamicdrive.com/forums/showthread.php?t=58709" target="_blank">Sticky Tooltip script - not sticky</a><br />
<br />
and here:<br />
<br />
<a href="http://www.dynamicdrive.com/forums/showthread.php?t=58692" target="_blank">Sticky Tooltip script - no dock in IE 7- for image map</a><br />
<br />
In those threads I offer piecemeal solutions, the first of which above is the most problematic:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_quote">
		<div class="quote_container">
			<div class="bbcode_quote_container"></div>
			
				<div class="bbcode_postedby">
					<img src="images/misc/quote_icon.png" alt="Quote" /> Originally Posted by <strong>jscheuer1</strong>
					<a href="showthread.php?p=240968#post240968" rel="nofollow"><img class="inlineimg" src="images/buttons/viewpost-right.png" alt="View Post" /></a>
				</div>
				<div class="message">Even on the demo page, if the tip is in sticky mode and one mouses over one of the other triggers, the tip changes position and content. Also in sticky mode, if one mouses out of the trigger and back over it, the content remains the same but the position changes.</div>
			
		</div>
	</div>
</div>There is also another issue:<br />
<br />
Since when sticky, clicking outside the box is what dismisses it, and the mouse is probably still over the trigger or may now be over another anchor link or area tag, if that tag links to another page, it will fire, taking the user away from the page when all they wanted to do was dismiss the sticky tip.<br />
<br />
This last and the first might actually be desirable in some cases, usually not.<br />
<br />
Since all three are worth updating, I've made a combined script that addresses all three and includes two new options to allow the first and second to be toggles:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:300px;">/*
* Sticky Tooltip script (v1.0)
* Created: Nov 25th, 2009. This notice must stay intact for usage 
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code

* Unofficial Modifications 11/2010:
* Allows for optional disabling of links on the page while sticky is in sticky mode
* Allows for optional extremesticky behavior to override the original codes 'bug' in stickiness
* Fixes sticky on right click for image maps in IE 6 and 7
*/

var stickytooltip={
	tooltipoffsets: [20, -30], //additional x and y offset from mouse cursor for tooltips
	fadeinspeed: 200, //duration of fade effect in milliseconds
	rightclickstick: true, //sticky tooltip when user right clicks over the triggering element (apart from pressing &quot;s&quot; key) ?
	stickybordercolors: ['black', 'darkred'], //border color of tooltip depending on sticky state
	stickynotice1: ['Press &quot;s&quot;', 'or right click', 'to sticky box'], //customize tooltip status message
	stickynotice2: 'Click outside this box to hide it', //customize tooltip status message
<code style="background-color: #FFFFBB">	stickykillclicks: true, //while tooltip is sticky, should links on the page be temporarily disabled?
	extremestick: true, //while tooltip is sticky, should all other triggers be temporarily disabled?</code>

	//***** NO NEED TO EDIT BEYOND HERE</pre>
</div>The stickykillclicks option apparently does not disable links in the sticky tip, which is a good thing. I just haven't figured out why yet.<br />
<br />
The extremestick option prevents all the triggers from taking over and moving and/or changing the sticky tip when in sticky mode.<br />
<br />
The IE 6 and 7 issue for image maps is dealt with and obviously needs no toggle.<br />
<br />
Anyways, here's the code (right click and 'save as'):<br />
<br />
<a href="http://www.dynamicdrive.com/forums/attachment.php?attachmentid=4679&amp;d=1292519600"  title="Name:  stickytooltip.js
Views: 3878
Size:  4.5 KB">stickytooltip.js</a><br />
<br />
It's a drop in replacement for the original script, everything else remains the same as instructed on the demo page.<br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>12/10 - Added another update: script will now properly follow border color changes using the stickybordercolors configuration. The original only changed the background of the bottom panel.</i></div></blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?48-Sticky-Tooltip-script-Unofficial-Update</guid>
		</item>
		<item>
			<title>Styling Descriptions for Ultimate Fade-in slideshow (v2.1)</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?45-Styling-Descriptions-for-Ultimate-Fade-in-slideshow-(v2-1)</link>
			<pubDate>Tue, 18 May 2010 10:33:32 GMT</pubDate>
			<description>There are actually 4 css selectors that can figure in this. Only three of them really matter. If you only have one show on your page, you only need to think about the last two. The selectors are: 
 
 
1. The id of the show, #fadeshow1, for example. 
2. .fadeslidedescdiv - the class for all...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">There are actually 4 css selectors that can figure in this. Only three of them really matter. If you only have one show on your page, you only need to think about the last two. The selectors are:<br />
<br />
<ol class="decimal"><li style="">The id of the show, <code style="background-color: #FFFFBB"><span style="font-family: Arial">#fadeshow1</span></code>, for example.<br />
<br /></li><li style=""><code style="background-color: #FFFFBB"><span style="font-family: Arial">.fadeslidedescdiv</span></code> - the class for all description containers.<br />
<br /></li><li style=""><code style="background-color: #FFFFBB"><span style="font-family: Arial">.descpanelbg</span></code> - the class for all description backgrounds.<br />
<br /></li><li style=""><code style="background-color: #FFFFBB"><span style="font-family: Arial">.descpanelfg</span></code> - the class for all description foregrounds.</li></ol><br />
<br />
Though it can be used for some things, you can safely ignore <code style="background-color: #FFFFBB"><span style="font-family: Arial">.fadeslidedescdiv</span></code> in almost all cases. The background panel controls the background color and opacity of the background color for the descriptions. Any background color or opacity you want to enforce here must use the !important keyword in order to override the script's internal styles for these. The foreground panel may be used to style the color and font of the description. It's font styles need no override, but it's color styles do.<br />
<br />
So, for example, if you wanted to change the background to red, the color to black and the font to Comic Sans MS:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:108px;">.descpanelbg {
	background-color: red!important;
}
.descpanelfg {
	font-family: 'comic sans ms', sans-serif;
	color: black!important;
}</pre>
</div>You can change the font-size, line-height, pretty much anything you want. And the above method of using the selectors will work fine as long as you either have only one slide show on the page, or wish to style the descriptions in all slide shows on the page in the same manner.<br />
<br />
In cases where there are more than one show on the page and you want your customization to apply to only one show, use its wrapper id as a prefix, ex:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;"><code style="background-color: #FFFFBB">#fadeshow1</code> .descpanelfg {
	font-family: 'comic sans ms', sans-serif;
	color: black!important;
}</pre>
</div></blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?45-Styling-Descriptions-for-Ultimate-Fade-in-slideshow-(v2-1)</guid>
		</item>
		<item>
			<title>Get Style</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?41-Get-Style</link>
			<pubDate>Thu, 04 Mar 2010 14:37:47 GMT</pubDate>
			<description><![CDATA[Sometimes we want to get the style of something.  But, since it wasn't set inline or via javascript, or perhaps was set in a stylesheet using the: 
 
 
Code: 
--------- 
!important 
--------- 
keyword that overrides inline and javascript assignments, we cannot access it.  Here is a fairly robust...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Sometimes we want to get the style of something.  But, since it wasn't set inline or via javascript, or perhaps was set in a stylesheet using the:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">!important</pre>
</div>keyword that overrides inline and javascript assignments, we cannot access it.  Here is a fairly robust script that will allow us to do so in many cases:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:372px;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
   &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
<code style="background-color: #FFFFBB">function getStyle(){
	return null;
}
if(document.getElementById){
	(function(){
		if(window.getComputedStyle){
			var hump = /([A-Z])/g;
			function toDash(a, b){return '-' + b.toLowerCase();};
			function decamel(str){return str.replace(hump, toDash);};
		} else {
			var dash = /-(.)/g;
			function toHump(a, b){return b.toUpperCase();};
			function encamel(str){return str.replace(dash, toHump);};
		}
		getStyle = (function(){
			return window.getComputedStyle? function(el, styleProp){
				return document.defaultView.getComputedStyle(el? document.getElementById(el)
				: document.body, null).getPropertyValue(decamel(styleProp));
			} : function(el, styleProp){return (el? document.getElementById(el)
				: document.body).currentStyle[encamel(styleProp)];};
		})();
	})();
}</code>

onload = function(){alert(getStyle(null, 'background-color'));};
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;test&quot;&gt;
Hi
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>You may pass it an element's id and property to get that element's style property value as currently viewed by the browser.  Or, use null and a property to get the body's style property value for that property.<br />
<br />
This works in IE 5.5+ and virtually all modern browsers.<br />
<br />
You may use the hyphenated or the camel style notation for properties which require them.  For properties that are bundled, like border, margin, etc.  You may have to ask for specific components of those styles.  For instance:<br />
<br />
border-left-width<br />
<br />
not just border or border-left.<br />
<br />
If a property is undefined, you may get an empty string or 'undefined', or perhaps even some other 'falsey' value.  It depends upon whether or not the browser sees the property as having a default value or not, and if not, how it chooses to express that.  Pixels and other position/dimension units may be converted to other valid units representing the same position/dimension in some browsers, and color values may be expressed in any of their various equivalent values (text, hex, decimal).  That depends upon the browser and sometimes how (if at all) the value was assigned.<br />
<br />
For most things though, you will get what you expect.  In other cases, some tweaking of the property asked for, and/or tweaking of the interpretation of the result may be required.</blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?41-Get-Style</guid>
		</item>
		<item>
			<title>Combining Ultimate Fade-in Slideshow 2.1 and Lightwindow 2.0</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?37-Combining-Ultimate-Fade-in-Slideshow-2-1-and-Lightwindow-2-0</link>
			<pubDate>Wed, 07 Oct 2009 15:10:41 GMT</pubDate>
			<description><![CDATA[I've found that this actually can work.  It makes an interesting use of the slide show's undocumented oninit feature, and how well the slide show is written visa vis jQuery's No Conflict mode.  I would generally advise using two scripts which work off of the same script library, rather than two...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I've found that this actually can work.  It makes an interesting use of the slide show's undocumented oninit feature, and how well the slide show is written visa vis jQuery's No Conflict mode.  I would generally advise using two scripts which work off of the same script library, rather than two different script libraries.  However, in this case both scripts are so robust, who can resist?<br />
<br />
That said, all you need to do to set up a demo is to follow the instructions for Ultimate Fade on its demo page.  Then replace the second slide show's script code with this script code (additions/changes highlighted):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:348px;">var mygallery2=new fadeSlideShow({
	wrapperid: &quot;fadeshow2&quot;, //ID of blank DIV on page to house Slideshow
	dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of largest image
	imagearray: [
		[&quot;http://i26.tinypic.com/11l7ls0.jpg&quot;, &quot;<code style="background-color: #FFFFBB">http://stickmanlabs.com/images/kevin_vegas.jpg&quot;</code>, &quot;<code style="background-color: #FFFFBB">lightwindow::true::title::Waiting for the show to start in Las Vegas::author::Jazzmatt::caption::Mmmmmm Margaritas! And yes, this is me...</code>&quot;, &quot;Nothing beats relaxing next to the pool when the weather is hot.&quot;],
		[&quot;http://i29.tinypic.com/xp3hns.jpg&quot;, &quot;http://en.wikipedia.org/wiki/Cave&quot;, &quot;_new&quot;, &quot;Some day I'd like to explore these caves!&quot;],
		[&quot;http://i30.tinypic.com/531q3n.jpg&quot;],
		[&quot;http://i31.tinypic.com/119w28m.jpg&quot;, &quot;&quot;, &quot;&quot;, &quot;What a beautiful scene with everything changing colors.&quot;] //&lt;--no trailing comma after very last image element!
	],
	displaymode: {type:'manual', pause:2500, cycles:0, wraparound:false},
	persist: false, //remember last viewed slide and recall within same session?
	fadeduration: 500, //transition duration (milliseconds)
	descreveal: &quot;always&quot;,
	togglerid: &quot;fadeshow2toggler&quot;
})

<code style="background-color: #FFFFBB">mygallery2.setting.oninit = function(){
	this.setting.$gallerylayers.find('a[target]').each(function(){
		var t = this.target.split('::'), o = {}, i = 2;
		if(t.length &gt; 1 &amp;&amp; t[0] === 'lightwindow' &amp;&amp; t[1] === 'true'){
			o.href = this.href;
			for(i; i &lt; t.length; ++i)
				o[t[i++]] = t[i];
			jQuery(this).bind('click', function(e){myLightWindow.activateWindow(o);if(e &amp;&amp; e.preventDefault){e.preventDefault();}else return false;});
		}
	});
};</code></pre>
</div>After the closing script tag for the above code, add your Lightwindow files, and make sure they are available to the page:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:96px;">	. . . 
&lt;/script&gt;
<code style="background-color: #FFFFBB">&lt;script type=&quot;text/javascript&quot; src=&quot;javascript/prototype.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;javascript/scriptaculous.js?load=effects&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;javascript/lightwindow.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/lightwindow.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;</code></pre>
</div>One other thing, you will need to up the z-indexes in the lightwindow.css file in three spots:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:168px;">#lightwindow_overlay {
	/* REQUIRED */
	display: none;
	visibility: hidden;
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100px;
	z-index: <code style="background-color: #FFFFBB">10000</code>;
	/* REQUIRED */
}</pre>
</div>and:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:144px;">#lightwindow {
	/* REQUIRED */
	/* Of Note - The height and width of this element are set to 0px */
	display: none;
	visibility: hidden;
	position: absolute;
	z-index: <code style="background-color: #FFFFBB">10001</code>;
	line-height: 0px;
	/* REQUIRED */
}</pre>
</div>and:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:168px;">#lightwindow_loading {
	/* REQUIRED */
	height: 100%;
	width: 100%;
	top: 0px;
	left: 0px;
	z-index: <code style="background-color: #FFFFBB">10001</code>;
	position: absolute;
	/* REQUIRED */
	background-color: #f0f0f0;
	padding: 10px;
}</pre>
</div>After you've done these things, simply click on the first image in the second slide show and watch the Lightwindow open up.<br />
<br />
Demo (click on first image in second slide show):<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/ufade21_lw2/" target="_blank">http://home.comcast.net/~jscheuer1/side/ufade21_lw2/</a><br />
<br />
Lightwindow Home:<br />
<br />
<a href="http://www.p51labs.com/lightwindow/" target="_blank">http://www.p51labs.com/lightwindow/</a><br />
<br />
Ultimate Fade Home:<br />
<br />
<a href="http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm" target="_blank">http://www.dynamicdrive.com/dynamici...nslideshow.htm</a></blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?37-Combining-Ultimate-Fade-in-Slideshow-2-1-and-Lightwindow-2-0</guid>
		</item>
		<item>
			<title>Compact Cookie Unit</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?32-Compact-Cookie-Unit</link>
			<pubDate>Wed, 24 Jun 2009 00:50:26 GMT</pubDate>
			<description>Cookies are often confusing.  Much of the confusion can be eliminated if you know that all cookies are strings.  If you want to store an array, function, number, or an object in a cookie, you must convert it to a string before storage and upon retrieval change it back into the...</description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Cookies are often confusing.  Much of the confusion can be eliminated if you know that all cookies are strings.  If you want to store an array, function, number, or an object in a cookie, you must convert it to a string before storage and upon retrieval change it back into the object/array/function/number that it was.  Cookies are therefore best used for string storage and retrieval.  This unit doesn't pretend to eliminate all of the possible confusions that can arise from &quot;when and where in my code is the best place to set/read/delete the cookie&quot;.  However, it does greatly simplify those actions:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:276px;">var cook = {
	set: function(n, v, d){ // cook.set takes (name, value, optional_persist_days) - defaults to session if no days specified
		if(d){var dt = new Date(); 
			dt.setDate(dt.getDate() + d);
		d = '; expires=' + dt.toGMTString();}
		document.cookie = n + '=' + escape(v) + (d || '') + '; path=/';
	},
	get: function(n){ // cook.get takes (name)
		var c = document.cookie.match('(^|;)\x20*' + n + '=([^;]*)');
		return c? unescape(c[2]) : null;
	},
	kill: function(n){ // cook.kill takes (name)
		cook.set(n, '', -1);
	},
	killall: function(){ // cook.killall takes no parameters
		var cookies = document.cookie.split(';'), i = cookies.length - 1;
		for (i; i &gt; -1; --i){
			cook.kill(cookies[i].split('=')[0]);
		}
	}
};</pre>
</div>Usage is indicated in the comments.  For example, to set a cookie named 'bob' to a value of 'your uncle' to persist for 2 days:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">cook.set('bob', 'your uncle', 2);</pre>
</div>To read said cookie (it will return its <b>string</b> value if set, null if not set) - no semicolon follows the example because it will most often be a part of an if or variable assignment statement.<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">cook.get('bob')</pre>
</div>To wit:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;">if(<code style="background-color: #FFFFBB">cook.get('bob')</code>)
  <font color="Green">do one thing</font>
else
  <font color="#008000">do another thing</font></pre>
</div>To erase said cookie:<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:36px;">cook.kill('bob');</pre>
</div>That's it!<br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>July 2010 - changed the name of the object to cook from cookie as this was giving errors in some browsers. Added killall function.</i></div></blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?32-Compact-Cookie-Unit</guid>
		</item>
		<item>
			<title>Swiss Army II</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?18-Swiss-Army-II</link>
			<pubDate>Sat, 28 Mar 2009 14:09:53 GMT</pubDate>
			<description><![CDATA[I just wanted to Blog this info to make it easy to find.  It regards the Swiss Army Slide Show script: 
 
http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm 
 
Because many people want even more flexibility than it originally provided, I've updated it (script only, right click 'save...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I just wanted to Blog this info to make it easy to find.  It regards the Swiss Army Slide Show script:<br />
<br />
<a href="http://www.dynamicdrive.com/dynamicindex14/swissarmy/index.htm" target="_blank">http://www.dynamicdrive.com/dynamici...army/index.htm</a><br />
<br />
Because many people want even more flexibility than it originally provided, I've updated it (script only, right click 'save as'):<br />
<br />
<a href="http://home.comcast.net/~jscheuer1/side/files/swiss_2.js" target="_blank">http://home.comcast.net/~jscheuer1/s...les/swiss_2.js</a><br />
<br />
This is a drop in replacement for swissarmy.js and requires no changes in the on page code other than to use this new external script in place of the original external script.<br />
<br />
However - It adds the following style hooks (some were already there in the original version but undocumented on its demo page):<br />
<br />
<ul><li style="">#outer$ - outer division containing the show images.</li><li style="">#master$ - division directly nested in #outer$, contains the two divisions that hold the tables that hold the images.</li><li style="">#canvas$_0 - one of the two divisions that holds a table that holds the images.</li><li style="">#canvas$_1 - the other of the two divisions that holds a table that holds the images.</li><li style="">#desc$ - outer division containing the descriptions (holds the description prefix text, if used, and the below description span).</li><li style="">#imgdsc$ - span that holds the descriptions.</li><li style="">#counter$ - outer division holding the counter.</li><li style="">#thecnt$ - span updated with actual image counter.</li><li style="">#controls$ - outer division for the controls, if using images for buttons, this is actually a table.</li><li style="">#prev$ - input button for previous image.</li><li style="">#gostp$ - input button that starts or stops the slide show (a toggle).</li><li style="">#next$ - input button for next image.</li><li style="">#goto$ - text input for jumpto feature.</li><li style="">#go$ - input button &quot;GO&quot; button for jumpto feature.</li></ul><br />
<br />
Each slideshow on your page has a number. The first one is 0, the second one is 1 and so on. If you only have one slideshow, it's 0. So to style the description's outer container for it, use a style rule like (for example, replacing the $ with the number corresponding to the slideshow):<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:72px;">#desc0 {
 position: relative;
 top: - 5px;
}</pre>
</div>The script also adds the following optional configuration properties:<br />
<br />
<ul><li style="">slides#.previous_value - defaults to ' &lt;&lt; '</li><li style="">slides#.next_value - defaults to ' &gt;&gt; '</li><li style="">slides#.move_desc_up - set to 1 to move descriptions up for shorter images, requires position:relative; and z-index:100; for #imgdsc$ style selector.</li><li style="">slides#.desc_pic_width - set to 1 for description container (#desc0) width to follow changing image widths</li><li style="">slides#.count_prefix - text to prefix the count, defaults to 'Viewing Image: '</li><li style="">slides#.count_sep - text to separate the two count numbers, defaults to 'of'</li><li style="">slides#.once - Stop after one revolution? Use 1 for stop at last slide, 2 for stop at first slide. Omit or use 0 for continuous slide show.</li></ul><br />
<br />
<div style="border:1px solid red; width: 95%; padding: 5px;"><b>Edit:</b> <i>Amended to include slides#.once property 8/10<br />
Add precision in the description of this update 9/10</i></div></blockquote>

]]></content:encoded>
			<dc:creator>jscheuer1</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?18-Swiss-Army-II</guid>
		</item>
	</channel>
</rss>
