<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Javascript Archives - Shawn DeWolfe Consulting</title>
	<atom:link href="https://shawndewolfe.com/category/code-example/javascript/feed" rel="self" type="application/rss+xml" />
	<link>https://shawndewolfe.com/category/code-example/javascript</link>
	<description>Web Design &#124; WordPress Development &#124; WordPress Support</description>
	<lastBuildDate>Wed, 23 Aug 2023 17:34:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.3</generator>

<image>
	<url>https://shawndewolfe.com/wp-content/uploads/2019/05/cropped-favicon-32x32.png</url>
	<title>Javascript Archives - Shawn DeWolfe Consulting</title>
	<link>https://shawndewolfe.com/category/code-example/javascript</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Calculating Interest</title>
		<link>https://shawndewolfe.com/calculating-interest.html</link>
					<comments>https://shawndewolfe.com/calculating-interest.html#respond</comments>
		
		<dc:creator><![CDATA[Shawn DeWolfe]]></dc:creator>
		<pubDate>Sun, 10 Oct 2021 02:52:10 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Code Example]]></category>
		<category><![CDATA[Interest]]></category>
		<guid isPermaLink="false">https://shawndewolfe.com/?p=4959</guid>

					<description><![CDATA[<p>Javascript for interest calculation.</p>
<p>The post <a href="https://shawndewolfe.com/calculating-interest.html">Calculating Interest</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="et_d4_element et_pb_section et_pb_section_0 et_section_regular et_block_section" >
				
				
				
				
				
				
				<div class="et_d4_element et_pb_row et_pb_row_0 et_block_row">
				<div class="et_d4_element et_pb_column_4_4 et_pb_column et_pb_column_0  et_pb_css_mix_blend_mode_passthrough et-last-child et_block_column">
				
				
				
				
				<div class="et_pb_module et_d4_element et_pb_text et_pb_text_0  et_pb_text_align_left et_pb_bg_layout_light">
				
				
				
				
				<div class="et_pb_text_inner"><p>&lt;script language="JavaScript"&gt;</p>
<p>// Parameters are rate, total number of periods, payment made each period and future value<br />function pv(rate, nper, pmt, fv) {<br />rate = parseFloat(rate);<br />nper = parseFloat(nper);<br />pmt = parseFloat(pmt);<br />fv = parseFloat(fv);<br />if ( nper == 0 ) {<br />alert("Why do you want to test me with zeros?");<br />return(0); <br />}<br />if ( rate == 0 ) { // Interest rate is 0<br />pv_value = -(fv + (pmt * nper));<br />} else {<br />x = Math.pow(1 + rate, -nper); <br />y = Math.pow(1 + rate, nper);<br />pv_value = - ( x * ( fv * rate - pmt + y * pmt )) / rate;<br />}<br />pv_value = pv_value.toFixed(2);<br />return (pv_value);<br />}</p>
<p>function fv(rate, nper, pmt, pv) {<br />rate = parseFloat(rate);<br />nper = parseFloat(nper);<br />pmt = parseFloat(pmt);<br />pv = parseFloat(pv);<br />if ( nper == 0 ) {<br />alert("Why do you want to test me with zeros?");<br />return(0);<br />}<br />if ( rate == 0 ) { // Interest rate is 0<br />fv_value = -(pv + (pmt * nper));<br />} else {<br />x = Math.pow(1 + rate, nper);<br />fv_value = - ( -pmt + x * pmt + rate * x * pv ) /rate;<br />}<br />fv_value = fv.toFixed(2);<br />return (fv_value); <br />}</p>
<p>function pmt(rate, payments, pv, fv, advancedpmts) {<br />var t1 = 1 + rate<br />var t2 = Math.pow(t1,payments)<br />var t3 = Math.pow(t1,(payments - advancedpmts))<br />return (pv - (fv/t2))/(((1-(1/(t3))) / rate) + advancedpmts);<br />} </p>
<p>&lt;/script&gt;</p></div>
			</div><div class="et_pb_module et_d4_element et_pb_text et_pb_text_1  et_pb_text_align_left et_pb_bg_layout_light">
				
				
				
				
				<div class="et_pb_text_inner"><p>Perserved from <a href="https://www.mohaniyer.com/old/pvcode.htm">https://www.mohaniyer.com/old/pvcode.htm</a></p></div>
			</div>
			</div>
				
				
				
				
			</div>
				
				
			</div>
<p>The post <a href="https://shawndewolfe.com/calculating-interest.html">Calculating Interest</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://shawndewolfe.com/calculating-interest.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>jQuery &#038; WordPress: how to avoid common conflicts</title>
		<link>https://shawndewolfe.com/jquery-wordpress-how-to-avoid-common-conflicts.html</link>
					<comments>https://shawndewolfe.com/jquery-wordpress-how-to-avoid-common-conflicts.html#respond</comments>
		
		<dc:creator><![CDATA[Shawn DeWolfe]]></dc:creator>
		<pubDate>Thu, 06 Apr 2017 07:26:26 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shawndewolfe.com/?p=4821</guid>

					<description><![CDATA[<p>JQuery is great for WordPress. It&#8217;s a clear and effective library for Javascript. It gives WordPress some of its best functionality. Custom JQuery code can be added to plugins and themes. This code can make something work great but kill some other standard feature. WordPress already includes JQuery. Here&#8217;s how to include your own. In [&#8230;]</p>
<p>The post <a href="https://shawndewolfe.com/jquery-wordpress-how-to-avoid-common-conflicts.html">jQuery &#038; WordPress: how to avoid common conflicts</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>JQuery is great for WordPress. It&#8217;s a clear and effective library for Javascript. It gives WordPress some of its best functionality. Custom JQuery code can be added to plugins and themes. This code can make something work great but kill some other standard feature.</p>
<p>WordPress already includes JQuery. Here&#8217;s how to include your own. In the header.php file of your theme <strong><em>before</em></strong> wp_head(), include this:</p>
<blockquote><p>&lt;?php wp_enqueue_script(&#8220;jquery&#8221;); ?&gt;</p></blockquote>
<p>So it looks like this, instead:</p>
<blockquote><p>&lt;?php wp_enqueue_script(&#8220;jquery&#8221;); ?&gt;<br />
&lt;?php wp_head(); ?&gt;</p></blockquote>
<p>Now you can call your own jQuery include:</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;/web/path-to-theme/&#8221;&lt;?php&#8221; bloginfo(&#8220;template_url&#8221;); ?&gt;/jQuery.js&#8221;&gt;</p></blockquote>
<p>This should handle most cases, but if you want to be really safe, set &#8220;no conflict&#8221; mode in your own jQuery. That cleans up collisions between competing JavaScript functions.</p>
<blockquote><p>var $j = jQuery.noConflict();</p>
<p>$j(function(){</p>
<p>// some function code</p>
<p>});</p></blockquote>
<p>&nbsp;</p>
<p>The post <a href="https://shawndewolfe.com/jquery-wordpress-how-to-avoid-common-conflicts.html">jQuery &#038; WordPress: how to avoid common conflicts</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://shawndewolfe.com/jquery-wordpress-how-to-avoid-common-conflicts.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Color Picker</title>
		<link>https://shawndewolfe.com/color-picker</link>
		
		<dc:creator><![CDATA[Shawn DeWolfe]]></dc:creator>
		<pubDate>Sat, 12 Oct 2019 18:02:03 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Example]]></category>
		<guid isPermaLink="false">https://shawndewolfe.com/?p=1878</guid>

					<description><![CDATA[<p>A Colour Wheel Picker. Choose the colours you want. </p>
<p>The post <a href="https://shawndewolfe.com/color-picker">Color Picker</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>This colour wheel allows users to choose the braces elastics they want. It&#8217;s a fun little tool. More than that, it&#8217;s a ranking magnet. A ranking magnet? Google and others assess how long a user is on a web page. This gives people a chance to experiment with the brace elastic colours. While this wheel works for teeth, it could be swapped for anything else that needs to be customized.<br />
<p class='codepen'  data-height='265' data-theme-id='0' data-slug-hash='gZrWpv' data-default-tab='html,result' data-animations='run' data-editable='' data-embed-version='2'>
See the Pen ColorPicker by Shawn DeWolfe (@dewolfe001) on CodePen.</p>

Do you want a colour picker like this for your project? <a href="mailto:shawn@shawndewolfe.com?subject=Color+Picker">Contact me</a>!</p>
<p>The post <a href="https://shawndewolfe.com/color-picker">Color Picker</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CSS and Javascript effect: A Misty Reveal</title>
		<link>https://shawndewolfe.com/css-and-javascript-effect-a-misty-reveal</link>
		
		<dc:creator><![CDATA[Shawn DeWolfe]]></dc:creator>
		<pubDate>Sat, 12 Oct 2019 15:56:46 +0000</pubDate>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Code Example]]></category>
		<guid isPermaLink="false">https://shawndewolfe.com/?p=1867</guid>

					<description><![CDATA[<p>An example of how to make a transition effect that fades away.</p>
<p>The post <a href="https://shawndewolfe.com/css-and-javascript-effect-a-misty-reveal">CSS and Javascript effect: A Misty Reveal</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>I wanted to do a reveal with the following elements:</p>
<ul>
<li>It masks a region behind a layer. In this case, a PNG with some transparency</li>
<li>On hover, it zooms and adds a blur effect to make it look misty</li>
<li>As it zooms in, its opacity diminishes</li>
<li>I added some JQuery code to remove the misty layer altogether.</li>
<li>The shape of the foreground image can be changed.</li>
</ul>
<p class='codepen'  data-height='265' data-theme-id='0' data-slug-hash='ExxPjev' data-default-tab='css,result' data-animations='run' data-editable='' data-embed-version='2'>
See the Pen Mist Donut by Shawn DeWolfe (@dewolfe001) on CodePen.</p>

<p>The post <a href="https://shawndewolfe.com/css-and-javascript-effect-a-misty-reveal">CSS and Javascript effect: A Misty Reveal</a> appeared first on <a href="https://shawndewolfe.com">Shawn DeWolfe Consulting</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
