<?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>Blue Anvil Journal &#187; jQuery Plugins &amp; Snippets</title>
	<atom:link href="http://blue-anvil.com/category/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blue-anvil.com</link>
	<description>The online blogfolio of Mike Jolley</description>
	<lastBuildDate>Fri, 03 Dec 2010 18:16:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Easy jQuery Pull Quotes</title>
		<link>http://blue-anvil.com/archives/easy-jquery-pull-quotes/</link>
		<comments>http://blue-anvil.com/archives/easy-jquery-pull-quotes/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 01:43:04 +0000</pubDate>
		<dc:creator>Mike Jolley</dc:creator>
				<category><![CDATA[jQuery Plugins & Snippets]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Pull Quotes]]></category>

		<guid isPermaLink="false">http://blue-anvil.com/archives/easy-jquery-pull-quotes</guid>
		<description><![CDATA[Pull quotes, lift-out quotes, or call-outs are a handy method of drawing reader&#8217;s attention to a section of text. Recently, on a couple of client projects, I&#8217;ve seen the need to enhance large blocks of text so the user could skim read them without missing the really important parts. Pull quotes seemed perfect for this, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blue-anvil.com/img/pull.gif" class="floatleft" style="float:left;margin:0 4px 2px 0;" alt="Pull Quotes" />Pull quotes, lift-out quotes, or call-outs are a handy method of drawing reader&#8217;s attention to a section of text. Recently, on a couple of client projects, I&#8217;ve seen the need to enhance large blocks of text so the user could skim read them without missing the really important parts. Pull quotes seemed perfect for this, so I created a small jQuery script to take care of them.</p>
<p>In this article I demonstrate an easy method of creating pull quotes from a block of text using <a href="http://jquery.com/">jQuery</a> (a JavaScript library), CSS, and the html <code>span</code> element. I hope you find this method useful.</p>
<p><span id="more-110"></span></p>
<h2>The code</h2>
<p>To use the easy pull quote script you need the javascript and the css code, then a simple <code>span</code> surrounding what you want to be in the pullquote.</p>
<h3>Javascript</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// When the page is ready...</span>
$<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span>
   <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
   <span style="color: #009900;">&#123;</span>
&nbsp;
	   	<span style="color: #006600; font-style: italic;">// Easy Pullquotes by Mike Jolley</span>
                <span style="color: #006600; font-style: italic;">// Go through each span element with a classname of &quot;pullquote&quot;</span>
		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'span.pullquote'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #006600; font-style: italic;">// Get the text of the span</span>
			text <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">text</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #006600; font-style: italic;">// Get rid of unwanted charactors</span>
			text<span style="color: #339933;">=</span>text.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/\((.*)\)/gi</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot; &quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                        <span style="color: #006600; font-style: italic;">// Check if this is to be a right or left pull quote and output it</span>
			<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #000066; font-weight: bold;">is</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.right&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> 
				$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;blockquote class=&quot;pullquote right&quot;&gt;&lt;p&gt;&amp;quot;'</span><span style="color: #339933;">+</span> text <span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;quot;&lt;/p&gt;&lt;/blockquote&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000066; font-weight: bold;">else</span>
				$<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">parent</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">before</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;blockquote class=&quot;pullquote&quot;&gt;&lt;p&gt;&amp;quot;'</span><span style="color: #339933;">+</span> text <span style="color: #339933;">+</span><span style="color: #3366CC;">'&amp;quot;&lt;/p&gt;&lt;/blockquote&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">// End pull quote code</span>
   <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>CSS</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="css" style="font-family:monospace;">blockquote<span style="color: #6666ff;">.pullquote</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #933;">15px</span> <span style="color: #933;">8px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">180px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #993333;">double</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span> <span style="color: #993333;">double</span> <span style="color: #cc00cc;">#ccc</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">border-left</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">border-right</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.6em</span><span style="color: #00AA00;">;</span>
        <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#fefefe</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
blockquote<span style="color: #6666ff;">.pullquote</span>.<span style="color: #000000; font-weight: bold;">right</span> <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">8px</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
blockquote<span style="color: #6666ff;">.pullquote</span> p <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.4em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#666</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<h2>Instructions</h2>
<p>For a left aligned pull quote simply wrap the text you want in the quote with a <code>span</code> with the classname &#8220;pullquote&#8221;:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;Lorem ipsum dolor sit amet &lt;span class=&quot;pullquote&quot;&gt;purus mollis dictum&lt;/span&gt;.&lt;/p&gt;</pre></div></div>

<p>For a left aligned pull quote also add the &#8220;right&#8221; classname:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p&gt;Lorem ipsum dolor sit amet &lt;span class=&quot;pullquote right&quot;&gt;purus mollis dictum&lt;/span&gt;.&lt;/p&gt;</pre></div></div>

<h2>Demo:</h2>
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum felis. Aliquam elit urna, dapibus id, gravida non, fermentum sit amet, libero. Aenean posuere ante at tellus. Nulla pharetra justo nec tellus. Cras feugiat sapien quis metus. Donec bibendum. Nam eget augue. Phasellus eu nisi. Vivamus tincidunt blandit leo. Integer eu mi et <span class="pullquote">purus mollis dictum</span>.</p>
<p>Mauris imperdiet lectus a ante. Nunc vestibulum lacus eu tortor. Sed et risus. Morbi orci leo, posuere adipiscing, pharetra ut, fringilla in, risus. Morbi auctor aliquam neque. Vivamus id lacus sit amet felis porta tincidunt. Pellentesque vehicula. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Fusce a elit fringilla turpis nonummy ultrices. <span class="pullquote right">Pellentesque in pede.</span> Phasellus non dolor et metus venenatis nonummy. Proin sit amet eros vitae mi tempus convallis. Mauris vel dui sit amet risus facilisis luctus. Sed quis orci. Phasellus vitae velit ac mauris viverra pellentesque. Curabitur eros.</p>
<h2>Acknowledgments</h2>
<p>My Easy pull quotes were inspired by <a href="http://www.456bereastreet.com/archive/200609/automatic_pullquotes_with_javascript_and_css/">Roger Johansson&#8217;s automatic pull quotes</a> which use normal JavaScript and CSS to achieve the same effect.</p>
<p><p style="text-align:center"><script type="text/javascript"><!--
google_ad_client = "pub-6928386133078955";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "FFFFFF";
google_color_bg = "FFFFFF";
google_color_link = "444444";
google_color_text = "444444";
google_color_url = "444444";
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p></p>
]]></content:encoded>
			<wfw:commentRss>http://blue-anvil.com/archives/easy-jquery-pull-quotes/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Anti-aliased Rounded corners with JQuery</title>
		<link>http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery/</link>
		<comments>http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 15:04:19 +0000</pubDate>
		<dc:creator>Mike Jolley</dc:creator>
				<category><![CDATA[jQuery Plugins & Snippets]]></category>
		<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[rounded corners]]></category>

		<guid isPermaLink="false">http://82.110.105.91/blue-anvil.co.uk/?p=91</guid>
		<description><![CDATA[Recently I&#8217;ve been searching for a method of creating nice looking rounded corners with Javascript &#038; JQuery. First I found the &#8220;JQuery Corner&#8221; plugin for rounded corners, but was disappointed that it did not include smooth, anti-aliased corners. I then did some more google-trawling and found this post, which contained a modified version of Curvy [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blue-anvil.com/img/rounded.gif" class="floatleft" style="float:left;margin:0 4px 2px 0;" alt="Rounded Corners" />Recently I&#8217;ve been searching for a method of creating nice looking rounded corners with Javascript &#038; JQuery. </p>
<p>First I found the <a href="http://www.methvin.com/jquery/jq-corner-demo.html">&#8220;JQuery Corner&#8221; plugin</a> for rounded corners, but was disappointed that it did not include smooth, anti-aliased corners.</p>
<p>I then did some more google-trawling and found <a href="http://www.aspcode.net/JQuery-Curvy-Corners.aspx">this post</a>, which contained a modified version of <a href="http://www.curvycorners.net/">Curvy Corners</a> for use with JQuery. Now this script was much much better.</p>
<p>However&#8230;the filesize was a massive 40kb, way too big for production use, and to make things worse the code was not compatible with <a href="http://dean.edwards.name/packer/">packer</a> so I could not reduce the filesize.</p>
<p>Well, I got busy, and fixed the errors. It is now fully packer friendly meaning easy rounded corners in JQuery at only <del>9kb</del> <del>8kb</del> <del>15kb</del> <del>20kb</del> <del>16kb</del> <ins>10kb</ins>. Excellent. Read more for the download link.</p>
<p><span id="more-91"></span></p>
<h2>Demo and download</h2>
<div class="roundme" style="margin:32px 0px 32px !important; padding:4px;background-color:#E2ECEE;border:1px solid #9DDAE6">See the <a href="http://blue-anvil.com/jquerycurvycorners/test.html">demo page here</a></div>
<p>You can also grab the plugin from <a href="http://code.google.com/p/jquerycurvycorners/">Google Code</a>.</p>
<p class="center"><a class="downloadlink dlimg" href="http://blue-anvil.com/download/list" title="Version 1.9 downloaded 115592 times" ><img src="http://blue-anvil.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download JQuery Curvy Corners Version 1.9" /></a></p>
<p>The packed version is only 10kb, the uncompressed version is 23kb (thats half the size of the original script!).</p>
<h2>Quick example</h2>
<p>To make a curvy cornered box simply use:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">		$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.round_this'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">corner</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Thats all there is too it. A great script!</p>
<p>For more information on Curvy Corners, check out its <a href="http://www.curvycorners.net/">official site</a>.!</p>
<p><em>*Edit:</em> Found a small error in IE7 with the backgroundPosition property, fixed now. New file uploaded.</p>
<p><em>*Edit 2 &#8211; 25th Sep 07:</em> More optimizations, smaller file!</p>
<p><em>*Edit 3 &#8211; 29th Sep 07:</em> More optimizations, smaller file, and <a href="http://blue-anvil.com/jquerycurvycorners/test.html">demo page</a> up!</p>
<p><em>*Edit 4 &#8211; 6th March 08:</em> New version up with better background image support.</p>
<p><em>*Edit 5 &#8211; 19th May 08:</em> No extra padding, safari fixed, larger filesize to reduce overhead and increase speed.</p>
<p><em>*Edit 6 &#8211; 9th Aug 08:</em> General fixes from feedback</p>
<p><em>*Edit 7 &#8211; 7th Oct 08:</em>  Major overhaul to improve compatibility with other plugins</p>
<p><em>*Edit 8 &#8211; 2nd June 09:</em>  Now compatible with jquery 1.3.2 &#8211; All future updates will be on Google Code (http://code.google.com/p/jquerycurvycorners/) &#8211; Hence im closing comments here. Post your contributions either on google code or in the forum.</p>
]]></content:encoded>
			<wfw:commentRss>http://blue-anvil.com/archives/anti-aliased-rounded-corners-with-jquery/feed/</wfw:commentRss>
		<slash:comments>307</slash:comments>
		</item>
	</channel>
</rss>

