<?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>wax ideal &#187; programming</title>
	<atom:link href="http://waxideal.com/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://waxideal.com/blog</link>
	<description>learning to be human, since 1984</description>
	<lastBuildDate>Wed, 07 Dec 2011 21:46:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to trigger a jQuery Plugin (fancybox) if URL match</title>
		<link>http://waxideal.com/blog/2011/06/16/how-to-trigger-a-jquery-plugin-fancybox-if-url-match/</link>
		<comments>http://waxideal.com/blog/2011/06/16/how-to-trigger-a-jquery-plugin-fancybox-if-url-match/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 21:42:05 +0000</pubDate>
		<dc:creator>sarandi</dc:creator>
				<category><![CDATA[clients]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html/xhmtl]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://waxideal.com/blog/?p=626</guid>
		<description><![CDATA[I currently work for a venue &#8211; often times we have shows with multiple acts, so we need to list set times for each artist. Easy enough: I can write a modal-type pop-up window using fancybox that opens when the user clicks a link (&#8220;DJ Showtimes here&#8220;, for example). But say you want to send [...]]]></description>
			<content:encoded><![CDATA[<p>I currently work for a venue &#8211; often times we have shows with multiple acts, so we need to list set times for each artist. Easy enough: I can write a modal-type pop-up window using fancybox that opens when the user clicks a link (&#8220;DJ Showtimes <span style="text-decoration: underline;">here</span>&#8220;, for example). But say you want to send an email that links to that list? Since most email clients, web- or desktop-based, don&#8217;t allow javascript, I needed to trigger the click based on the URL. Here&#8217;s my solution (using a custom jQuery function to avoid conflicts with other libraries in use):</p>
<pre><code>
$j('#various2').fancybox({'hideOnContentClick': true, 'hideOnOverlayClick': true, 'showCloseButton': true, 'scrolling': 'auto'}); /* use id of link for fancybox selector */</code></pre>
<pre><code>/* necessary to set if-statement within page ready or load event */
</code></pre>
<pre><code>$j(document).ready(function() {
if(document.location.href.indexOf('#various2')&gt;-1){ /* check for anchor text in URL */
$j('#various2').fancybox().trigger('click'); /* chain click trigger on to previously written fancybox declaration */
}});
$j('#fancybox-wrap').css({'margin':'20px auto'}) /* set css for wrapper; safari was centering the inline element to the position of the #various2 element, which was at the top of the page. This resets to 20px top/bottom and in the middle horizontally */</code></pre>
<p>My link looks like this:</p>
<pre><code><a id="various2" href="#data">DJ Set Times Here</a></code></pre>
<p>and my content is wrapped with:</p>
<pre><code>
<div id="data">CONTENT HERE</div>

</code></pre>
<p>Easy, peasy.</p>
]]></content:encoded>
			<wfw:commentRss>http://waxideal.com/blog/2011/06/16/how-to-trigger-a-jquery-plugin-fancybox-if-url-match/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

