<?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>Uncharted Design - Blog &#187; javascript</title>
	<atom:link href="http://www.uncharteddesign.com/blog/tag/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.uncharteddesign.com/blog</link>
	<description></description>
	<lastBuildDate>Sat, 23 Apr 2011 22:55:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress Pages in jQuery Accordion</title>
		<link>http://www.uncharteddesign.com/blog/2010/10/wordpress-pages-in-jquery-accordion/</link>
		<comments>http://www.uncharteddesign.com/blog/2010/10/wordpress-pages-in-jquery-accordion/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 21:14:34 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.uncharteddesign.com/blog/?p=331</guid>
		<description><![CDATA[As usual I googled immensely to find someone doing it the way I thought it should be done, and didn&#8217;t find quite the right thing. I did find a good starting point from Wes Ray, jQuery Accordion for Wordpress. There were a few features that weren&#8217;t working, and then some that I found necessary to [...]]]></description>
			<content:encoded><![CDATA[<p>As usual I googled immensely to find someone doing it the way I thought it should be done, and didn&#8217;t find quite the right thing. I did find a good starting point from Wes Ray, <a href="http://www.wessray.com/jquery/jquery-accordion-for-wordpress/">jQuery Accordion for Wordpress</a>. There were a few features that weren&#8217;t working, and then some that I found necessary to add.</p>
<p>1) Menus need to expand when you&#8217;re on a page<br />
2) Ability to click the top level item<br />
3) Arrows indicating drop state.<br />
4) Degrades for users with no Java</p>
<p>Here&#8217;s my final code.  Please do refer to <a href="http://www.wessray.com/jquery/jquery-accordion-for-wordpress/">Wes&#8217; Post</a> for the full details.</p>
<p><strong>CSS<br />
</strong><br />
<code><br />
div#navigation .displayMe { display:block; }<br />
div#navigation ul {margin:10px 0 0; padding:0 10px 0 20px; list-style:none;}<br />
div#navigation .downarrow {margin:0 0 0 -12px; display:inline-block; width:14px; height:14px; background:url('http://www.prolumina.net/wordpress/wp-content/themes/prolumina/images/arrowsprite.jpg') 0 2px no-repeat;}<br />
div#navigation .down {background:url('http://www.prolumina.net/wordpress/wp-content/themes/prolumina/images/arrowsprite.jpg') 0 -11px no-repeat;}<br />
div#navigation ul li a {font-size:14px;}<br />
div#navigation ul ul {margin: 0; padding:0 10px 0 15px}<br />
div#navigation ul li {margin:4px 0;}<br />
div#navigation ul ul a {font-size:12px;}<br />
</code></p>
<p><strong>Java</strong><br />
<code><br />
jQuery(document).ready(function() { </code></p>
<p><code> </code></p>
<p><code>//Hide the submenus<br />
jQuery('#navigation ul li ul').hide();</code></p>
<p><code>//If its a page parent (based off wordpress), add the class "displayMe"<br />
//This way the accordion will be opened up on the page you are on.<br />
if (jQuery('#navigation ul li').hasClass("current_page_parent")) {<br />
jQuery('#navigation .current_page_parent ul').addClass("displayMe");<br />
jQuery('#navigation .current_page_ancestor &gt; ul').attr('style','display:block');<br />
jQuery('#navigation .current_page_parent &gt; ul').attr('style','display:block');<br />
}<br />
jQuery('#navigation .current_page_item &gt; ul').attr('style','display:block');</code></p>
<p><code>//Add a class to the parent li IF it has sub UL's<br />
jQuery("#navigation ul li:has(ul)").addClass("theDon");</code></p>
<p><code>//Da henchman<br />
jQuery("#navigation ul li ul li:has(a)").addClass("henchmen");</p>
<p>//Add a downarrow if it has a submenu<br />
jQuery('#navigation .theDon').prepend('<a class="downarrow" href="#"></a>');</p>
<p>//If it's active, mark the arrow as down<br />
jQuery('#navigation .theDon.current_page_item &gt; .downarrow').addClass('down');<br />
jQuery('#navigation .theDon.current_page_parent &gt; .downarrow').addClass('down');<br />
jQuery('#navigation .theDon.current_page_ancestor &gt; .downarrow').addClass('down');</p>
<p>//When you click it, toggle<br />
jQuery('#navigation ul li a').click(<br />
function() {</p>
<p>//Onclick Remove the class dipslay me which is only display:block;<br />
//This way they can close it if they click it or it will glitch<br />
jQuery(this).next().next().slideToggle('slow').removeClass("displayMe");<br />
if (jQuery(this).hasClass("down")) {<br />
jQuery(this).removeClass("down");<br />
}<br />
else if (jQuery(this).hasClass("downarrow")){<br />
jQuery(this).addClass("down");<br />
}</p>
<p>//return false so the # doenst move view to the top of the page<br />
if (jQuery(this).attr('href') == '#') { return false; }</p>
<p></code></p>
<p><code>//Close it all out<br />
});<br />
});<br />
</code></p>
<p><strong>Sprite</strong><br />
<a href="http://www.uncharteddesign.com/blog/wp-content/uploads/arrowsprite.jpg"><img class="alignnone size-full wp-image-335" src="http://www.uncharteddesign.com/blog/wp-content/uploads/arrowsprite.jpg" alt="Sprite for arrows" width="14" height="28" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncharteddesign.com/blog/2010/10/wordpress-pages-in-jquery-accordion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Integrating Galleria with Wordpress</title>
		<link>http://www.uncharteddesign.com/blog/2010/09/integrating-galleria-with-wordpress/</link>
		<comments>http://www.uncharteddesign.com/blog/2010/09/integrating-galleria-with-wordpress/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 21:27:14 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.uncharteddesign.com/blog/?p=319</guid>
		<description><![CDATA[WordPress Gallery meets the sophistication of jQuery Galleria]]></description>
			<content:encoded><![CDATA[<p>This is a simple way to get this working, but in all my googling I didn&#8217;t come across a write-up.  Here is how I got the beautiful jQuery Galleria to replace the default WordPress gallery. This is my ideal solution, and I am actively using it as a Photography CMS for a client&#8217;s portfolio.</p>
<p>Download <a href="http://galleria.aino.se/">Galleria</a> and upload it to your server, under your theme&#8217;s directory.</p>
<p>Call jQuery and then Galleria into your theme&#8217;s header.php (order matters, and if you already have a plugin calling jQuery you may need to do some tweaking, check your firebug console if things break):</p>
<p><code> &lt;script src="/galleria/jquery-1.5.2.js" type="text/javascript"&gt;&lt;/script&gt;<br />
&lt;script src="/galleria/galleria-1.2.3.min.js" type="text/javascript"&gt;&lt;/script&gt;<br />
</code></p>
<p>When putting a gallery into your post or page, flip to the HTML editor and change the shortcode to:</p>
<p><code>&#91;gallery link="file" itemtag="div" icontag="span" captiontag="p"&#93;<br />
</code><br />
For more on the WordPress Gallery, see <a href="http://codex.wordpress.org/Gallery_Shortcode">the codex</a>.</p>
<p>Now in the footer, just before &lt;/body&gt;:</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
if (Galleria.IE6 != true) {<br />
// If they're running ie6, don't even both. Otherwise, load theme<br />
Galleria.loadTheme('&lt;?php bloginfo('theme_url'); ?&gt;/galleria/themes/classic/galleria.classic.js');</code><code><br />
$('.gallery').galleria({ //These options are personal preference, see Galleria documentation<br />
image_crop: 'height',<br />
transition: 'fade',<br />
thumb_crop: false,<br />
transition_speed: 500,<br />
data_config: function(img) {<br />
// will extract and return image captions from the wordpress gallery source:<br />
return  {<br />
title: $(img).parent().next('strong').html(),<br />
description: $(img).parent().parent().next('p').html()<br />
};<br />
}<br />
});<br />
}</code></p>
<p><code> </code></p>
<p><code>&lt;/script&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncharteddesign.com/blog/2010/09/integrating-galleria-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>Mootools smooth scrolling gallery</title>
		<link>http://www.uncharteddesign.com/blog/2008/08/mootools-smooth-scrolling-gallery/</link>
		<comments>http://www.uncharteddesign.com/blog/2008/08/mootools-smooth-scrolling-gallery/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 00:12:33 +0000</pubDate>
		<dc:creator>Jordan</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.uncharteddesign.com/blog/?p=10</guid>
		<description><![CDATA[Update: Mootools is now on 1.2, with changes that break this script.  What really needs updating is the scroller.js, you can download it from mootools, or here from us.  Just update to the current version of mootools, and replace your existing scroller.js with the new one.
You can see the 1.2 Demo or download [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> Mootools is now on 1.2, with changes that break this script.  What really needs updating is the scroller.js, you can download it from <a href="http://mootools.net/more">mootools</a>, or <a href="http://www.uncharteddesign.com/tuts/GalleryDemo/scripts/scroller1.2.js">here</a> from us.  Just update to the current version of mootools, and replace your existing scroller.js with the new one.</p>
<p>You can see the <a title="See the 1.2 demo" href="http://www.uncharteddesign.com/tuts/GalleryDemo/UD_gallery1.2.html" target="_blank">1.2 Demo</a> or <a title="Download the 1.2 gallery demo" href="http://www.uncharteddesign.com/tuts/GalleryDemo/GalleryDemo1.2.zip" target="_blank">download</a> the zip.</p>
<hr />
The gallery on our old site used a JavaScript/Css method that I think is worth sharing.  You can use this on your site by just modifying the HTML and images.</p>
<p><img class="aligncenter" title="Gallery Screen Shot" src="http://www.uncharteddesign.com/tuts/GalleryDemo/ss.jpg" alt="Gallery Screen Shot" /><br />
<a href="http://www.uncharteddesign.com/tuts/GalleryDemo/UD_gallery.html" target="_blank">Live Demo</a> or <a href="http://www.uncharteddesign.com/tuts/GalleryDemo/GalleryDemo.zip" target="_blank">download </a></p>
<p>The end result came from combining two ideas, a smooth scrolling div and a script that injects the large container with information from the thumbnail that you click.  The script I used for the basic gallery is &#8220;Javascript image gallery using mootools&#8221; by Devin R, available <a href="http://tutorialdog.com/javascript-image-gallery-using-mootools/" target="_blank">here</a></p>
<p>The other part is the scrolling based on mouse movement. I modified a script from Antonio Lupetti, &#8220;Using CSS and Mootools to simulate Flash horizontal navigation effect,&#8221; the original is <a href="http://woork.blogspot.com/2008/03/using-css-and-mootools-to-simulate.html" target="_blank">here</a>.</p>
<p>The challenges here involved integrating the structures of HTML, CSS and JavaScript that the two methods used, and making the site accessible for users with no JavaScript and for those on cellphone browsers.  Tested working in FF 2/3, IE 6/7, BlackBerry Mobile, Opera Mini.</p>
<p>I&#8217;ve made a simple demo for you to take a <a title="See the demo" href="http://www.uncharteddesign.com/tuts/GalleryDemo/UD_gallery.html" target="_blank">look at</a> or <a title="Download the gallery demo" href="http://www.uncharteddesign.com/tuts/GalleryDemo/GalleryDemo.zip" target="_blank">download</a>.</p>
<p>Let me know if you have any questions and I&#8217;ll do my best to answer them.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.uncharteddesign.com/blog/2008/08/mootools-smooth-scrolling-gallery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

