<?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 - keyboard1333</title>
		<link>http://www.dynamicdrive.com/forums/blog.php?56681-keyboard1333</link>
		<description>Dynamic Drive help forum</description>
		<language>en</language>
		<lastBuildDate>Fri, 24 May 2013 01:11:18 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 - keyboard1333</title>
			<link>http://www.dynamicdrive.com/forums/blog.php?56681-keyboard1333</link>
		</image>
		<item>
			<title>Scroll to Top Script</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?265-Scroll-to-Top-Script</link>
			<pubDate>Thu, 11 Oct 2012 01:00:34 GMT</pubDate>
			<description><![CDATA[Here's my alternative to the ddscript Jquery Scroll to Top Control V1.1 (http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm) 
 
*Attachment 4800 (http://www.dynamicdrive.com/forums/attachment.php?attachmentid=4800)* 
 
 
Code: 
--------- 
$.fn.scroll_to_top = function(userOptions) { 
	var...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">Here's my alternative to the ddscript <a href="http://www.dynamicdrive.com/dynamicindex3/scrolltop.htm" target="_blank">Jquery Scroll to Top Control V1.1</a><br />
<br />
<b><a href="http://www.dynamicdrive.com/forums/attachment.php?attachmentid=4800&amp;d=1349917057"  title="Name:  scroll_to_top.js
Views: 492
Size:  2.0 KB">scroll_to_top.js</a></b><br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:372px;">$.fn.scroll_to_top = function(userOptions) {
	var check_scroll = 0;
    var defaultOptions = {
		image : 'jump_to_top.png',
		image_height : '6%',
		image_width : '3%',
		scroll_distance : 200,
		scroll_location : 0,
		scroll_speed : 600,
		button_animate_speed : 200,
		button_animate_type : 'fade',
		position : 'bottom_left'
    };
    var args = defaultOptions;
    if(typeof userOptions === 'object') { 
		args = $.extend(defaultOptions,userOptions);
	}
	switch(args.position) {
		case 'top_left':
			var css = 'top:0;left:0;';
		break;
		case 'top_right':
			var css = 'top:0;right:0;';
		break;
		case 'bottom_right':
			var css = 'bottom:0;right:0;';
		break;
		case 'center':
			var css = 'top:50%;bottom:50%;left:50%;right:50%;';
		break;
		default:
			var css = 'bottom:0;left:0;';
	}
	css += 'margin-bottom:5px;margin-top:5px;margin-left:5px;margin-right:5px;display:none;position:fixed;height:' + args.image_height + ';width:' + args.image_width + ';cursor:pointer;';
	$('body').append('&lt;img src=&quot;' + args.image + '&quot; alt=&quot;Scroll to top&quot; title=&quot;Scroll to top&quot; id=&quot;scroll_to_top&quot; style=&quot;' + css + '&quot;/&gt;');
	$(window).scroll(function() {
		if($(this).scrollTop() &gt; args.scroll_distance) {
			switch(args.button_animate_type) {
				case 'slide' : 
					$('#scroll_to_top').slideDown(args.button_animate_speed);
				break;
				default:
					$('#scroll_to_top').fadeIn(args.button_animate_speed);
			}
        } else {
			switch(args.button_animate_type) {
				case 'slide' : 
					$('#scroll_to_top').slideUp(args.button_animate_speed);
				break;
				default:
					$('#scroll_to_top').fadeOut(args.button_animate_speed);
			}
        }
		if(check_scroll === 1) {
			if($(this).scrollTop() === 0) {
				if(typeof args.success != &quot;undefined&quot;) {
					args.success();
					check_scroll = 0;
				}
			}
		}
	});
	$('#scroll_to_top').click(function() {
		$('body,html').animate({
			scrollTop : args.scroll_location
		}, args.scroll_speed);
		check_scroll = 1;
	});
};</pre>
</div>To call the script, put this code in the &lt;head&gt;&lt;/head&gt; of your body -<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:264px;">&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scroll_to_top.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(window).load(function(){ 
	$('body').scroll_to_top({
		image : &quot;jump_to_top.png&quot;,
		image_height : &quot;6%&quot;,
		image_width : &quot;3%&quot;,
		scroll_distance : 200,
		scroll_speed : 600,
		//scroll_location : 50,
		button_animate_speed : 200,
		button_animate_type : 'fade',
		position : 'bottom_left',
		success : function() {
			//alert(&quot;Complete&quot;);
		}
	});
});
&lt;/script&gt;</pre>
</div>Just edit the settings as needed.<br />
If you do not pass one of the settings to the script, the default settings will kick in.<br />
<br />
Here's the image used, but you can substitute your own - <a href="http://www.dynamicdrive.com/forums/attachment.php?attachmentid=4790&amp;d=1349917057"  title="Name:  scroll_to_top.js
Views: 492
Size:  2.0 KB">Attachment 4790</a><br />
<br />
<a href="http://jsfiddle.net/mEGkF/" target="_blank">Here's</a> a working example.</blockquote>

]]></content:encoded>
			<dc:creator>keyboard1333</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?265-Scroll-to-Top-Script</guid>
		</item>
		<item>
			<title>Show plain text in a password field</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?257-Show-plain-text-in-a-password-field</link>
			<pubDate>Wed, 06 Jun 2012 12:51:05 GMT</pubDate>
			<description><![CDATA[I was browsing the internet and came across this tecnique and thought it was rather cool. 
 
*To make plain text show in a password field, you need the following form - * 
 
 
HTML: 
--------- 
 <form> 
 <input type="text" name="passwordPlain" id="passwordPlain" value="Password"...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I was browsing the internet and came across this tecnique and thought it was rather cool.<br />
<br />
<b>To make plain text show in a password field, you need the following form - </b><br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<pre class="bbcode_code" style="height:6*12px};"> <span style="color:#FF8000">&lt;form&gt;</span>
 <span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;text&quot;</span> name=<span style="color:#0000FF">&quot;passwordPlain&quot;</span> id=<span style="color:#0000FF">&quot;passwordPlain&quot;</span> value=<span style="color:#0000FF">&quot;Password&quot;</span> onfocus=<span style="color:#0000FF">&quot;swapPasswordBoxes('click')&quot;</span> style=<span style="color:#0000FF">&quot;display:none;&quot;</span>/&gt;</span>
 <span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;password&quot;</span> name=<span style="color:#0000FF">&quot;password&quot;</span> id=<span style="color:#0000FF">&quot;password&quot;</span> value=<span style="color:#0000FF">&quot;&quot;</span> onblur=<span style="color:#0000FF">&quot;swapPasswordBoxes('blur')&quot;</span> /&gt;</span>
 <span style="color:#FF8000">&lt;/form&gt;</span></pre>
</div><b>Run this function once the page has loaded</b> (<code style="background-color: #FFFFBB">&lt;body onload=&quot;onPageLoaded()&quot;&gt;</code>)<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<pre class="bbcode_code" style="height:6*12px};">function onPageLoaded() {
	document.getElementById('password').style.display = &quot;none&quot;;
	document.getElementById('passwordPlain').style.display = &quot;inline&quot;;
}</pre>
</div><b>And add this function to your javascript as well</b><br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<pre class="bbcode_code" style="height:14*12px};">function swapPasswordBoxes(funcType) {
	if(funcType == &quot;click&quot;) {	
		document.getElementById('passwordPlain').style.display = &quot;none&quot;;
		document.getElementById('password').style.display = &quot;inline&quot;;
		document.getElementById('password').focus();
	} else {
		if(document.getElementById('password').value.length == 0) {
			document.getElementById('passwordPlain').style.display = &quot;inline&quot;;
			document.getElementById('password').style.display = &quot;none&quot;;
		}
	}
}</pre>
</div>This means that the plain text box is visible to the user when they load the page (if they have javascript {else it just shows the standard password box}).<br />
<br />
Then when they click on the plain text box, that box is made invisible and the password box is made visible (and it sets the focus to this box as well). If they click off the password box, and the box is empty, it is reset to the plain text box.<br />
<br />
<b>Full working code -</b><br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">HTML Code:</div>
	<pre class="bbcode_code" style="height:31*12px};"><span style="color:#000080">&lt;!DOCTYPE html&gt;</span>
<span style="color:#000080">&lt;html&gt;</span>
<span style="color:#000080">&lt;head&gt;</span>
<span style="color:#800000">&lt;script type=<span style="color:#0000FF">&quot;text/javascript&quot;</span>&gt;</span>
function onPageLoaded() {
	document.getElementById('password').style.display = &quot;none&quot;;
	document.getElementById('passwordPlain').style.display = &quot;inline&quot;;
}
function swapPasswordBoxes(funcType) {
	if(funcType == &quot;click&quot;) {	
		document.getElementById('passwordPlain').style.display = &quot;none&quot;;
		document.getElementById('password').style.display = &quot;inline&quot;;
		document.getElementById('password').focus();
	} else {
		if(document.getElementById('password').value.length == 0) {
			document.getElementById('passwordPlain').style.display = &quot;inline&quot;;
			document.getElementById('password').style.display = &quot;none&quot;;
		}
	}
}
<span style="color:#800000">&lt;/script&gt;</span>
<span style="color:#000080">&lt;/head&gt;</span>
<span style="color:#000080">&lt;body onload=<span style="color:#0000FF">&quot;onPageLoaded()&quot;</span>&gt;</span>
<span style="color:#FF8000">&lt;form&gt;</span>
<span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;text&quot;</span> name=<span style="color:#0000FF">&quot;passwordPlain&quot;</span> id=<span style="color:#0000FF">&quot;passwordPlain&quot;</span> value=<span style="color:#0000FF">&quot;Password&quot;</span> onfocus=<span style="color:#0000FF">&quot;swapPasswordBoxes('click')&quot;</span> style=<span style="color:#0000FF">&quot;display:none;&quot;</span>/&gt;</span>
<span style="color:#FF8000">&lt;input type=<span style="color:#0000FF">&quot;password&quot;</span> name=<span style="color:#0000FF">&quot;password&quot;</span> id=<span style="color:#0000FF">&quot;password&quot;</span> value=<span style="color:#0000FF">&quot;&quot;</span> onblur=<span style="color:#0000FF">&quot;swapPasswordBoxes('blur')&quot;</span> /&gt;</span>
<span style="color:#FF8000">&lt;/form&gt;</span>
<span style="color:#000080">&lt;/body&gt;</span>
<span style="color:#000080">&lt;/html&gt;</span></pre>
</div></blockquote>

]]></content:encoded>
			<dc:creator>keyboard1333</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?257-Show-plain-text-in-a-password-field</guid>
		</item>
		<item>
			<title>document.getElementById shortcut</title>
			<link>http://www.dynamicdrive.com/forums/entry.php?254-document-getElementById-shortcut</link>
			<pubDate>Thu, 22 Mar 2012 08:38:08 GMT</pubDate>
			<description><![CDATA[I'm amazed at how many people don't use a very simple shortcut for document.getElementById. This is for all the people who don't use a javascript library like jQuery. 
 
All you have to do is include this code somewhere on your page 
 
 
Code: 
--------- 
function $(element) { 
return...]]></description>
			<content:encoded><![CDATA[<blockquote class="blogcontent restore">I'm amazed at how many people don't use a very simple shortcut for document.getElementById. This is for all the people who don't use a javascript library like jQuery.<br />
<br />
All you have to do is include this code somewhere on your page<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:60px;">function $(element) {
return document.getElementById(element);
}</pre>
</div>Then when you want to use <code style="background-color: #FFFFBB">document.getElementById('id');</code> just type $('id'); instead.<br />
<br />
Example<br />
<br />
<div class="bbcode_container">
	<div class="bbcode_description">Code:</div>
	<pre class="bbcode_code"style="height:180px;">&lt;html&gt;
&lt;head&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function $(element) {
return document.getElementById(element);
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;input type=&quot;text&quot; value=&quot;Hello&quot; id=&quot;field1&quot;&gt;
&lt;input type=&quot;button&quot; onclick=&quot;alert($('field1').value)&quot;&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
</div>I think it's a real time saver and more people should use it.</blockquote>

]]></content:encoded>
			<dc:creator>keyboard1333</dc:creator>
			<guid isPermaLink="true">http://www.dynamicdrive.com/forums/entry.php?254-document-getElementById-shortcut</guid>
		</item>
	</channel>
</rss>
