<?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>Dave Cavins &#187; jQuery</title>
	<atom:link href="http://davecavins.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://davecavins.com</link>
	<description>web design, SharePoint customization &#38; random stuff</description>
	<lastBuildDate>Mon, 14 Jun 2010 18:48:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Improving #SharePoint Forms – Watermarks</title>
		<link>http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/</link>
		<comments>http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/#comments</comments>
		<pubDate>Mon, 03 May 2010 18:58:59 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[better forms]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=509</guid>
		<description><![CDATA[So I found this cool jQuery plugin that does watermarks for form inputs. Using watermarks is a good way to help make SharePoint forms easier to use. To test the plugin I started with the new item form from same test list I used in my previous posts. Improving #SharePoint Forms – Hints Improving #SharePoint Forms [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/01/improving-sharepoint-forms/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms'>Improving #SharePoint Forms</a></li>
<li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/' rel='bookmark' title='Permanent Link: Resizable textareas in SharePoint edit forms'>Resizable textareas in SharePoint edit forms</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So I found this <a rel="no follow" href="http://plugins.jquery.com/project/TinyWatermark" target="_blank">cool jQuery plugin</a> that does watermarks for form inputs. Using watermarks is a good way to help make SharePoint forms easier to use. To test the plugin I started with the new item form from same test list I used in my previous posts.</p>
<ul>
<li><a href="http://davecavins.com/2010/02/improving-sharepoint-forms-hints/">Improving #SharePoint Forms – Hints</a></li>
<li><a href="http://davecavins.com/2010/02/character-count-on-sharepoint-fields/">Improving #SharePoint Forms – Character Count</a></li>
</ul>
<div id="attachment_515" class="wp-caption alignnone" style="width: 529px"><img class="size-full wp-image-515" title="watermarks" src="http://davecavins.com/wp-content/uploads/2010/05/watermarks.jpg" alt="" width="519" height="274" /><p class="wp-caption-text">Watermarks</p></div>
<h2>Prerequisites</h2>
<ul>
<li>jQuery Library referenced in the page</li>
<li>CEWP on the page</li>
</ul>
<p><span id="more-509"></span></p>
<h2>Setup</h2>
<p>First make sure you reference a copy of the plugin script. I added the link to the section of the page using the method explained in <a href="http://davecavins.com/2010/02/character-count-on-sharepoint-fields/">this post</a>.</p>
<pre class="brush: xml;">&lt;script type=&quot;text/javascript&quot; src=&quot;../../jquery.tinywatermark-2.0.0.js&quot;&gt;&lt;/script&gt;</pre>
<p>We also need some css to style the watermarks</p>
<pre class="brush: css;">
  &lt;style type=&quot;text/css&quot;&gt;
  .watermark {color:#999}
&lt;/style&gt;
</pre>
<p>The plugin works by finding all the inputs with a class of &#8220;watermarked&#8221; and using this title attribute as the watermark. So I used jQuery to select the inputs I wanted to watermark and <a href="http://api.jquery.com/addClass/" target="_blank">add the &#8220;watermarked&#8221; class</a> to them.</p>
<p>Here is the code I used.</p>
<pre class="brush: jscript;">
$(&quot;input[title='Author']&quot;).addClass('watermarked');
$(&quot;input[title='Title']&quot;).addClass('watermarked');
$(&quot;textarea[title='Body']&quot;).addClass('watermarked');
</pre>
<p>After the inputs have the right class all we need to do is call the plugin script like so</p>
<pre class="brush: jscript;">
$('.watermarked').each(function() {
  $(this).watermark('watermark', $(this).attr('title'));
});
</pre>
<p>Thats all. Enjoy.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/01/improving-sharepoint-forms/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms'>Improving #SharePoint Forms</a></li>
<li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/' rel='bookmark' title='Permanent Link: Resizable textareas in SharePoint edit forms'>Resizable textareas in SharePoint edit forms</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Switch List Displays with JQuery and CSS</title>
		<link>http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/</link>
		<comments>http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 20:58:05 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=483</guid>
		<description><![CDATA[Sometimes it is useful to allow users to quickly change how data is displayed. Changing the display can make is easier to see patterns or find a specific item you are looking for. With CSS and jQuery we can easily change the way content is displayed and arranged on the page.  I got the idea [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/' rel='bookmark' title='Permanent Link: CSS-Tricks AnythingSlider in SharePoint'>CSS-Tricks AnythingSlider in SharePoint</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is useful to allow users to quickly change how data is displayed. Changing the display can make is easier to see patterns or find a specific item you are looking for. With CSS and jQuery we can easily change the way content is displayed and arranged on the page.  I got the idea for this post from <a title="Link" href="http://designm.ag/tutorials/jquery-display-switch/ " target="_blank">here</a>  </p>
<div id="attachment_484" class="wp-caption aligncenter" style="width: 600px"><img class="size-full wp-image-484" title="viewswitch" src="http://davecavins.com/wp-content/uploads/2010/03/viewswitch.gif" alt="" width="590" height="450" /><p class="wp-caption-text">Switch views using CSS and jQuery</p></div>
<p> </p>
<p><a href="http://designm.ag/tutorials/jquery-display-switch/"><span id="more-483"></span><br />
</a>Basically by changing the class assigned to a div wrapping the content we are able to change the way things are laid out and hide what we don&#8217;t need.  Here how I set it up in SharePoint.  </p>
<ul>
<li>I started with a standard Image library and added some images of one of my bikes.  I filled in the title and description for each item.  <strong>You can use this same technique on other types of lists.</strong></li>
<li>Next I created a page and displayed the list in a dataview web part</li>
<li>I edited the XSL to show the items in an unordered list with a class of  &#8216;display&#8217;. Inside of each &lt;li&gt; I used various tags and classes to style the images and descriptions.
<pre class="brush: xml;">
&lt;li class=&quot;ms-vb&quot;&gt;
&lt;div class=&quot;content_block&quot;&gt;
	&lt;a href=&quot;{concat($FileURL,'/Forms/DispForm.aspx?ID=',@ID)}&quot;&gt;
	&lt;img align=&quot;left&quot; border=&quot;0&quot; src=&quot;{concat($FileURL,'/_t/',$FileNameNoEx,'_',@FileType,'.',@FileType)}&quot; alt=&quot;{@Title}&quot;/&gt;
	&lt;/a&gt;
	&lt;h2&gt;
		&lt;a href=&quot;{concat($FileURL,'/Forms/DispForm.aspx?ID=',@ID)}&quot;&gt;&lt;xsl:value-of select=&quot;@Title&quot; disable-output-escaping=&quot;yes&quot;/&gt;&lt;/a&gt;
	&lt;/h2&gt;
	&lt;p&gt;&lt;xsl:value-of select=&quot;@Description&quot; disable-output-escaping=&quot;yes&quot;/&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
</pre>
</li>
<li>Before the opening &lt;ul&gt; tag I added the link to my CSS and jQuery files as well as some script to trigger the switch and the associated link.
<pre class="brush: jscript;">
&lt;link href=&quot;styles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
	$(&quot;a.switch_thumb&quot;).toggle(function(){
	$(this).addClass(&quot;swap&quot;);
	$(&quot;ul.display&quot;).fadeOut(&quot;fast&quot;, function() {
		$(this).fadeIn(&quot;fast&quot;).addClass(&quot;thumb_view&quot;);
//  thumb_view is the class used for the alternate display style
		});	  },
		function () {
		 $(this).removeClass(&quot;swap&quot;);
		$(&quot;ul.display&quot;).fadeOut(&quot;fast&quot;, function() {
			$(this).fadeIn(&quot;fast&quot;).removeClass(&quot;thumb_view&quot;);
		}); }); });
&lt;/script&gt;
&lt;a href=&quot;#&quot; class=&quot;switch_thumb&quot;&gt;Switch Display&lt;/a&gt; /* link to trigger the switch */
</pre>
</li>
<li>Then I wrote some css to style the list differently based on the class of the &lt;ul&gt;. </li>
</ul>
<p>Below is the xsl and the CSS I used.</p>
<p><strong>XSL</strong> (includes the code above)</p>
<pre class="brush: xml;">
&lt;Xsl&gt;
&lt;xsl:stylesheet xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; version=&quot;1.0&quot; exclude-result-prefixes=&quot;xsl msxsl ddwrt&quot; xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot; xmlns:ddwrt2=&quot;urn:frontpage:internal&quot;&gt;
	&lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&gt;
	&lt;xsl:decimal-format NaN=&quot;&quot;/&gt;
		&lt;xsl:param name=&quot;dvt_apos&quot;&gt;'&lt;/xsl:param&gt;
		&lt;xsl:param name=&quot;url_PATH_INFO&quot; /&gt;
		&lt;xsl:param name=&quot;url_HTTP_HOST&quot; /&gt;
		&lt;xsl:variable name=&quot;dvt_1_automode&quot;&gt;0&lt;/xsl:variable&gt;
		&lt;xsl:template match=&quot;/&quot; xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1&quot;/&gt;
	&lt;/xsl:template&gt;
				&lt;xsl:template name=&quot;dvt_1&quot;&gt;
					&lt;xsl:variable name=&quot;dvt_StyleName&quot;&gt;BulTitl&lt;/xsl:variable&gt;
					&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row&quot; /&gt;
					&lt;link href=&quot;styles.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot;/&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-latest.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
$(document).ready(function(){
	$(&quot;a.switch_thumb&quot;).toggle(function(){
	  $(this).addClass(&quot;swap&quot;);
	  $(&quot;ul.display&quot;).fadeOut(&quot;fast&quot;, function() {
	  	$(this).fadeIn(&quot;fast&quot;).addClass(&quot;thumb_view&quot;);
		 });
	  }, function () {
      $(this).removeClass(&quot;swap&quot;);
	  $(&quot;ul.display&quot;).fadeOut(&quot;fast&quot;, function() {
	  	$(this).fadeIn(&quot;fast&quot;).removeClass(&quot;thumb_view&quot;);
		});	}); });
&lt;/script&gt; &lt;a href=&quot;#&quot; class=&quot;switch_thumb&quot;&gt;Switch Display&lt;/a&gt;
	&lt;ul class=&quot;display&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1.body&quot;&gt;
			&lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot; /&gt;
		&lt;/xsl:call-template&gt;
	&lt;/ul&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.body&quot;&gt;
		&lt;xsl:param name=&quot;Rows&quot; /&gt;
	&lt;xsl:for-each select=&quot;$Rows&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
	&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.rowview&quot;&gt;
		&lt;xsl:param name=&quot;FileNameString&quot; select=&quot;@NameOrTitle&quot;&gt;&lt;/xsl:param&gt;
		&lt;xsl:param name=&quot;FileNameLegnth&quot; select=&quot; string-length(@NameOrTitle) - 4&quot;&gt;&lt;/xsl:param&gt;
		&lt;xsl:param name=&quot;FileNameNoEx&quot; select=&quot; substring(@NameOrTitle,1,$FileNameLegnth)&quot;&gt;&lt;/xsl:param&gt;
		&lt;xsl:param name=&quot;FileURL&quot; select=&quot;concat('http://',$url_HTTP_HOST,'/',@FileDirRef)&quot;&gt;&lt;/xsl:param&gt;
	&lt;li class=&quot;ms-vb&quot;&gt;
		&lt;div class=&quot;content_block&quot;&gt;
			&lt;a href=&quot;{concat($FileURL,'/Forms/DispForm.aspx?ID=',@ID)}&quot;&gt;
				&lt;img align=&quot;left&quot; border=&quot;0&quot; src=&quot;{concat($FileURL,'/_t/',$FileNameNoEx,'_',@FileType,'.',@FileType)}&quot; alt=&quot;{@Title}&quot;/&gt;
			&lt;/a&gt;
			&lt;h2&gt;
				&lt;a href=&quot;{concat($FileURL,'/Forms/DispForm.aspx?ID=',@ID)}&quot;&gt;&lt;xsl:value-of select=&quot;@Title&quot; disable-output-escaping=&quot;yes&quot;/&gt;&lt;/a&gt;
			&lt;/h2&gt;
			&lt;p&gt;&lt;xsl:value-of select=&quot;@Description&quot; disable-output-escaping=&quot;yes&quot;/&gt;&lt;/p&gt;
			&lt;/div&gt;
		&lt;/li&gt;
		&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;&lt;/Xsl&gt;
</pre>
<p><strong>CSS</strong></p>
<pre class="brush: css;">
/* normal view styles */
ul.display li a {
    text-decoration: none;
}
ul.display li{
	background:#E3EFFF;
	margin:3px;
	border:1px solid #9FC2F1;
	height:130px;
	list-style:none;
}

ul.display li .content_block {
    padding: 5px;
	clear:both;
    margin:4px;
}
ul.display li .content_block h2 {
    margin: 0;
    padding: 2px;
    font-weight: normal;
    font-size: 1.4em;
}
ul.display li .content_block p {
    margin: 0;
    padding: 5px 5px 5px 145px;
    font-size: 1.2em;
}
ul.display li .content_block img{
    padding: 5px;
    border: 4px solid #336699;
    background: #fff;
    margin: 2 9px 2 2;
float: left;
}
/* thumbnail view styles */
ul.thumb_view li{ width: 200px; float:left; background:transparent; }
ul.thumb_view li h2 { display: inline; text-align:center; margin:2px; padding:2px }
ul.thumb_view li p{ display: none; }
ul.thumb_view li .content_block a img { margin: 5 0 10px; }
/* styles for the style switcher buttin */
a.switch_thumb {

	padding:5 5 5 25px;
	margin:10px;
	background:#D6E8FF url('/_layouts/images/itcat.gif') no-repeat 5px 7px;
	outline: none;
	border:1px solid #9FC2F1;
	font-size:.8em;
}
a:hover.switch_thumb {
	filter:alpha(opacity=75);
	opacity:.75;
	-ms-filter: &quot;progid:DXImageTransform.Microsoft.Alpha(Opacity=75)&quot;;
}
a.swap { background:url('/_layouts/images/itcontct.gif') no-repeat 5px 7px; }
</pre>
<p>If you want to use this same solution for a different type of list just create a dataview Web Part to display the items in the format you want and wrap everything in a container (div, ul, table) with a class. Also use tags (h2, p, span, div, etc.) to wrap the pieces of data you are displaying (this will make it easier to control with CSS). Change the CSS and JavaScript to work with you new container and XSL.  </p>
<p>Got questions? Post a comment.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/' rel='bookmark' title='Permanent Link: CSS-Tricks AnythingSlider in SharePoint'>CSS-Tricks AnythingSlider in SharePoint</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Improving #SharePoint Forms &#8211; Character Count</title>
		<link>http://davecavins.com/2010/02/character-count-on-sharepoint-fields/</link>
		<comments>http://davecavins.com/2010/02/character-count-on-sharepoint-fields/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 16:21:10 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[better forms]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=425</guid>
		<description><![CDATA[For the sake of demonstration I made a list called quotes. Each quote has a title, body and author field, as a requirement the body field should not have more than 200 characters. So to let users know when they are getting close to the character limit we will setup a character count script. For [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2010/01/improving-sharepoint-forms/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms'>Improving #SharePoint Forms</a></li>
<li><a href='http://davecavins.com/2010/02/improving-sharepoint-forms-hints/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Hints'>Improving #SharePoint Forms &#8211; Hints</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For the sake of demonstration I made a list called quotes. Each quote has a title, body and author field, as a requirement the body field should not have more than 200 characters. So to let users know when they are getting close to the character limit we will setup a character count script.</p>
<p>For this solution I will use <a href="http://cssglobe.com/post/7161/jquery-plugin-simplest-twitterlike-dynamic-character-count-for-textareas ">this jQuery script from CSS Globe</a>.</p>
<div id="attachment_422" class="wp-caption aligncenter" style="width: 597px"><a href="http://davecavins.com/wp-content/uploads/2010/01/form.jpg"><img class="size-full wp-image-422" title="form" src="http://davecavins.com/wp-content/uploads/2010/01/form.jpg" alt="" width="587" height="249" /></a><p class="wp-caption-text">The default form</p></div>
<p><span id="more-425"></span></p>
<h1>Setup</h1>
<p>So first off we need to add a link to the jQuery script and the plugin. You can do this using a content editor web part but I have noticed in some cases scripts need to be in the section of the page. The easiest way to add the scripts to the of the page is to use the following code.</p>
<pre class="brush: xml;">
&lt;asp:Content ContentPlaceHolderID=&quot;PlaceHolderAdditionalPageHead&quot; runat=&quot;server&quot;&gt;
&lt;!—scripts / css goes in here -- &gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;&gt;
  &lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;js/charCount.js&quot;&gt;&lt;/script&gt;
&lt;/asp:Content&gt;
</pre>
<p>So once you have all the scripts you need on the page we just need to attach the behavior to the form body form field. To do this we can add some JavaScript to the page in a Content Editor web part. We can use jQuery to select the element we want to target and then configure the plugin settings.</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;

$(&quot;textarea[title='Body']&quot;).charCount({
    allowed: 200,	 //maximum number of characters allowed
    warning: 175,  // when to show the warning
    counterText: 'Characters left:'  //text before the character count
});
&lt;/script&gt;
</pre>
<p>For more configuration options and explanations of the plugin check out this page.<br />
I used the following CSS to style the appearance of the character count text.</p>
<pre class="brush: css;">
.counter{
	position:relative;
	right:14px;
	top:0;
	font-size:12px;
	font-weight:normal;
	color:#555;
	float:right;
	clear:both;
	display:block;
	text-align:right;
	background:#fff;
	width:150px;
	padding:3px;
	border:1px solid #888;
	border-top:0px;
	margin-top:-1px;
	}
.warning{color:#660000; font-weight:bold;}
.exceeded{color:#e00; font-weight:bold;}
</pre>
<h1>In Action</h1>
<div id="attachment_430" class="wp-caption aligncenter" style="width: 604px"><a href="http://davecavins.com/wp-content/uploads/2010/02/counter.jpg"><img class="size-full wp-image-430" title="counter" src="http://davecavins.com/wp-content/uploads/2010/02/counter.jpg" alt="" width="594" height="116" /></a><p class="wp-caption-text">In Action</p></div>
<div id="attachment_431" class="wp-caption aligncenter" style="width: 603px"><a href="http://davecavins.com/wp-content/uploads/2010/02/counter2.jpg"><img class="size-full wp-image-431" title="counter2" src="http://davecavins.com/wp-content/uploads/2010/02/counter2.jpg" alt="" width="593" height="117" /></a><p class="wp-caption-text">Too many characters</p></div>
<p>In the next part of this series we will add hints to the form fields and make some other improvements.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2010/01/improving-sharepoint-forms/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms'>Improving #SharePoint Forms</a></li>
<li><a href='http://davecavins.com/2010/02/improving-sharepoint-forms-hints/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Hints'>Improving #SharePoint Forms &#8211; Hints</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/02/character-count-on-sharepoint-fields/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Improving #SharePoint Forms</title>
		<link>http://davecavins.com/2010/01/improving-sharepoint-forms/</link>
		<comments>http://davecavins.com/2010/01/improving-sharepoint-forms/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 02:43:15 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[better forms]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=420</guid>
		<description><![CDATA[Over the next few weeks I will be writing a series of posts on how to improve the out of the box SharePoint forms by using simple CSS and jQuery solutions.  These solutions will help improve usability as well as enhance the look and feel.  Look for the first post later this week. As a [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Over the next few weeks I will be writing a series of posts on how to improve the out of the box SharePoint forms by using simple CSS and jQuery solutions.  These solutions will help improve usability as well as enhance the look and feel.  Look for the first post later this week.</p>
<p>As a point of reference this is what we will be starting with.</p>
<div id="attachment_422" class="wp-caption aligncenter" style="width: 593px"><a href="http://davecavins.com/wp-content/uploads/2010/01/form.jpg"><img class="size-full wp-image-422" title="form" src="http://davecavins.com/wp-content/uploads/2010/01/form.jpg" alt="" width="583" height="247" /></a><p class="wp-caption-text">Standard SharePoint Form</p></div>
<p>Stay tuned for more soon.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/01/improving-sharepoint-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Displaying a rotating header image with caption</title>
		<link>http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/</link>
		<comments>http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 03:20:00 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[captify]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=403</guid>
		<description><![CDATA[Nothing makes a site look good like nice images. Using a large header graphic on you Sharepoint site can help direct users to some important information or announcement. Many non-SharePoint images use this technique to add interest to their site and attract visitors. Doing something like this in SharePoint will make your site a lot [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
<li><a href='http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/' rel='bookmark' title='Permanent Link: CSS-Tricks AnythingSlider in SharePoint'>CSS-Tricks AnythingSlider in SharePoint</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Nothing makes a site look good like nice images.  Using a large header graphic on you Sharepoint site can help direct users to some important information or announcement. Many non-SharePoint images use this technique to add interest to their site and attract visitors.  Doing something like this in SharePoint will make your site a lot less &#8216;SharePointy&#8217; (my made up word for sites that look like SharePoint).  Here is how I did it.</p>
<div id="attachment_413" class="wp-caption aligncenter" style="width: 446px"><a href="http://davecavins.com/wp-content/uploads/2010/01/caption.gif"><img class="size-full wp-image-413" title="caption" src="http://davecavins.com/wp-content/uploads/2010/01/caption.gif" alt="" width="436" height="218" /></a><p class="wp-caption-text">Rotating images with captions</p></div>
<p><span id="more-403"></span></p>
<h1>Setup</h1>
<ol>
<li>Create an Image Library to hold your header images,  I named my list &#8216;Headers&#8217;. You can add additional fields to the list if you want but its not necessary for this to work.</li>
<li>Find the images you want to use and re-size them to all be the same dimensions, I used 600px x 200px.</li>
<li>Upload the images to the library and fill in the meta data for each one. Just make sure the &#8216;Title&#8217; field has something in it because that is what we will use for our captions.</li>
</ol>
<h1>The hard part</h1>
<p>Ok really its not hard at all.</p>
<ol>
<li> In SharePoint Designer and add a data view web part to the page.  It does not matter what fields you show in the DVWP the important part is that it is pulling its contents from the Image Library you created.</li>
<li>Switch to &#8216;split view&#8217; and find the  tag. It should be right after the  tag in the code. Right click on the  tag and choose &#8216;Select&#8217; tag. Press delete.
<div id="attachment_408" class="wp-caption aligncenter" style="width: 170px"><a href="http://davecavins.com/wp-content/uploads/2010/01/codeview.jpg"><img class="size-full wp-image-408" title="codeview" src="http://davecavins.com/wp-content/uploads/2010/01/codeview.jpg" alt="" width="160" height="31" /></a><p class="wp-caption-text">Split view</p></div>
<div id="attachment_412" class="wp-caption aligncenter" style="width: 103px"><a href="http://davecavins.com/wp-content/uploads/2010/01/xsl.jpg"><img class="size-full wp-image-412" title="xsl" src="http://davecavins.com/wp-content/uploads/2010/01/xsl.jpg" alt="" width="93" height="71" /></a><p class="wp-caption-text">XSL tag</p></div>
<p><div id="attachment_411" class="wp-caption aligncenter" style="width: 213px"><a href="http://davecavins.com/wp-content/uploads/2010/01/selecttag1.jpg"><img class="size-full wp-image-411" title="selecttag" src="http://davecavins.com/wp-content/uploads/2010/01/selecttag1.jpg" alt="" width="203" height="126" /></a><p class="wp-caption-text">Select Tag</p></div></li>
<li>Paste this code where the  tag used to be.</li>
<pre class="brush: plain;">
&lt;XSL&gt;
&lt;xsl:stylesheet xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; version=&quot;1.0&quot; exclude-result-prefixes=&quot;xsl msxsl ddwrt&quot; xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot; xmlns:ddwrt2=&quot;urn:frontpage:internal&quot;&gt;
	&lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&gt;
	&lt;xsl:decimal-format NaN=&quot;&quot;/&gt;
	&lt;xsl:param name=&quot;dvt_apos&quot;&gt;'&lt;/xsl:param&gt;
	&lt;xsl:variable name=&quot;dvt_1_automode&quot;&gt;0&lt;/xsl:variable&gt;
	&lt;xsl:template match=&quot;/&quot; xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1&quot;/&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1&quot;&gt;
		&lt;xsl:variable name=&quot;dvt_StyleName&quot;&gt;Table&lt;/xsl:variable&gt;
		&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row&quot;/&gt;
		&lt;xsl:variable name=&quot;dvt_RowCount&quot; select=&quot;count($Rows)&quot; /&gt;
		&lt;xsl:variable name=&quot;IsEmpty&quot; select=&quot;$dvt_RowCount = 0&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js&quot;&gt;&lt;/script&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;sample.css?t=1&quot; /&gt;
	&lt;script type=&quot;text/javascript&quot; src=&quot;captify.tiny.js&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
this.randomtip = function(){
	var pause = 9000; // define the pause for each tip (in milliseconds)
	var length = $(&amp;quot;#headers li&amp;quot;).length;
	var temp = -1;
	this.getRan = function(){
		var ran = Math.floor(Math.random()*length) + 1;
		return ran;
	};
	this.show = function(){
		var ran = getRan();
		while (ran == temp){
			ran = getRan();
		};
		temp = ran;
		$(&amp;quot;#headers li&amp;quot;).hide();
		$(&amp;quot;#headers li:nth-child(&amp;quot; + ran + &amp;quot;)&amp;quot;).fadeIn(&quot;slow&quot;);
	};
	show(); setInterval(show,pause);
};
&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
	$(function(){
		$(&amp;apos;img.captify&amp;apos;).captify({});
	});
	$(document).ready(function(){
	randomtip();
});
	&lt;/script&gt; &lt;style type=&quot;text/css&quot;&gt;
#headers, #headers li{
	margin:0;
	padding:0;
	list-style:none;
	}
#headers li img{
	display:none; /* hide the items at first only */
	}
&lt;/style&gt;
&lt;ul id=&quot;headers&quot;&gt;
	&lt;xsl:call-template name=&quot;dvt_1.body&quot;&gt;
	&lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot;/&gt;
	&lt;/xsl:call-template&gt;
&lt;/ul&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.body&quot;&gt;
		&lt;xsl:param name=&quot;Rows&quot;/&gt;
		&lt;xsl:for-each select=&quot;$Rows&quot;&gt;
			&lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
		&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.rowview&quot;&gt;
&lt;li&gt;&lt;img border=&quot;0&quot; src=&quot;{@FileRef}&quot; alt=&quot;{@Title}&quot; class=&quot;captify&quot; title=&quot;{@Title}&quot;/&gt;&lt;/li&gt;
&lt;/xsl:template&gt;&lt;/xsl:stylesheet&gt;&lt;/XSL&gt;
</pre>
<h1>How it works</h1>
<p>This code displays the items from our list in an unordered list and then using the <a href="http://cssglobe.com/post/6023/simple-way-to-random-display-or-rotate-content-using">jQuery method explained here</a> it randomly chooses one to display. Initially they are all hidden by this css.</p>
<pre class="brush: css;">
&lt;style type=&quot;text/css&quot;&gt;
#headers, #headers li{
	margin:0;
	padding:0;
	list-style:none;
	}
#headers li img{display:none; /* hide the items at first only */}
&lt;/style&gt;
</pre>
<p>You can remove this from the xsl code and put it in your own external style sheet if you want. If you look at <a href="http://cssglobe.com/post/6023/simple-way-to-random-display-or-rotate-content-using">the article on CSS Glob</a>e where I got the code from there is also a way to make it show images randomly on page refresh.To diplay the captions I am using the <a rel="no-follow" href="http://ignati.com/captify-jquery-plugin-to-display-image-captions/">Captify jQuery plugin</a>. If you notice in the xsl I am adding a class of &#8216;captify&#8217; to each image, this is all the plugin needs to work. We just need to reference the plugin file and call the function like this:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
	$(function(){$('img.captify').captify({});
	});  //show captions on the images
	$(document).ready(function(){randomtip();
});  //display the random images
	&lt;/script&gt;
</pre>
<h1>In closing</h1>
<p>I have seen other methods of showing random content in the Data View Web Part such as this one:</p>
<pre class="brush: plain;">
&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row[@ID=ddwrt:Random(1,count(//Rows/Row))]&quot;/&gt;
</pre>
<p>However when I experimented with it there were issues with it choosing id&#8217;s that were not in the list and therefore nothing would display. If any one knows of an alternative solution please let me know.Overall this can be a very powerful tool for sharing information with your users. With a few small edits to the code and the list you can easily make each slide link to a page or a list item on your site.</p>
<p>If you have trouble getting this working on your site make sure the references to jQuery and the Captify script are correct, if they are right and you still have issues feel free to post a comment and I&#8217;ll do what I can to help out.</p>
<h1>Resources</h1>
</ol>
<ul>
<li><a rel="no-follow" href="http://www.jquery.com">jQuery</a></li>
<li><a rel="no-follow" href="http://github.com/caius/jquery-captify">Captify Plugin Download</a></li>
<li> <a rel="no-follow" href="http://cssglobe.com/post/6023/simple-way-to-random-display-or-rotate-content-using">Simple Way to Random Display or Rotate Content Using JavaScript and CSS</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
<li><a href='http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/' rel='bookmark' title='Permanent Link: CSS-Tricks AnythingSlider in SharePoint'>CSS-Tricks AnythingSlider in SharePoint</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hiding the user presence icon</title>
		<link>http://davecavins.com/2010/01/hiding-the-status-icon/</link>
		<comments>http://davecavins.com/2010/01/hiding-the-status-icon/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 21:40:48 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=389</guid>
		<description><![CDATA[When you are using a data view web part to display information including a person field SharePoint always shows the status icon beside thier name. In some cases this is exactly what you want and can be very useful. But sometimes you just want to show a name and nothing else. With most fields you [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<li><a href='http://davecavins.com/2009/10/sharepoint-blog-comments-p2/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments: Part 2'>Styling SharePoint Blog Comments: Part 2</a></li>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>When you are using a data view web part to display information including a person field SharePoint always shows the status icon beside thier name.</p>
<div id="attachment_391" class="wp-caption aligncenter" style="width: 241px"><img class="size-full wp-image-391" title="status icon" src="http://davecavins.com/wp-content/uploads/2010/01/status-icon1.jpg" alt="status icon" width="231" height="28" /><p class="wp-caption-text">status icon</p></div>
<p>In some cases this is exactly what you want and can be very useful. But sometimes you just want to show a name and nothing else. With most fields you can just change the formatting options to change the display. If you choose to format the value as text SharePoint spits out this long html string.</p>
<pre class="brush: xml;">&lt;nobr&gt;&lt;span&gt;&lt;A HREF=&quot;/sites/site/_layouts/userdisp.aspx?ID=2&quot;&gt;Cavins, David R&lt;/A&gt;&lt;img border=&quot;0&quot; height=&quot;1&quot; width=&quot;3&quot; src=&quot;/_layouts/images/blank.gif&quot;/&gt;&lt;a href='javascript:' onclick='IMNImageOnClick();return false;' class='ms-imnlink'&gt;&lt;img name='imnmark' title='' border='0' height='12' width='12' src='/_layouts/images/blank.gif' alt='No presence information' sip='email@email.com' id='imn_8,type=sip'/&gt;&lt;/a&gt;&lt;/span&gt;&lt;/nobr&gt;
</pre>
<p><div id="attachment_399" class="wp-caption aligncenter" style="width: 234px"><a href="http://davecavins.com/wp-content/uploads/2010/01/format1.jpg"><img src="http://davecavins.com/wp-content/uploads/2010/01/format1.jpg" alt="" title="format" width="224" height="175" class="size-full wp-image-399" /></a><p class="wp-caption-text">Format as</p></div><br />
Each of the other formatting options also provides un-desirable results.<br />
Using some basic CSS we can get rid of the status icon and format the text so it does not look like a hyperlink.  First wrap the field value in an element with a class. I used a span with a class of “person”</p>
<pre class="brush: xml;">
&lt;span class=”person”&gt;
&lt;xsl:value-of select=&quot;@Author&quot; /&gt;
&lt;/span&gt;
</pre>
<p>Then just add this css to the page.</p>
<pre class="brush: css;">
.person nobr span a {
text-decoration:none;
color:black;
cursor:default;
}
</pre>
<p>If you want to take it a step further you can use jQuery to remove the ‘href’ attribute.  Using jQuery we can target the container with the link in it and then change the href value. </p>
<pre class="brush: jscript;">
$('span.person a').removeAttr('href');
</pre>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/10/styling-sharepoint-blog-comments/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments'>Styling SharePoint Blog Comments</a></li>
<li><a href='http://davecavins.com/2009/10/sharepoint-blog-comments-p2/' rel='bookmark' title='Permanent Link: Styling SharePoint Blog Comments: Part 2'>Styling SharePoint Blog Comments: Part 2</a></li>
<li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2010/01/hiding-the-status-icon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS-Tricks AnythingSlider in SharePoint</title>
		<link>http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/</link>
		<comments>http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:10:42 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS-Tricks]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[xsl]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=366</guid>
		<description><![CDATA[Chris Coyier from CSS-Tricks built this really cool jQuery plugin that creates a content slider that will support any regular HTML in the slides. This is cool because many sliders I have used had limitations on what could be on the slides and did not offer many of the featuers the AnythingSlider does. Setup To [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
<li><a href='http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/' rel='bookmark' title='Permanent Link: Dynamic Drive&#8217;s Featured Content Slider in Sharepoint'>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Chris Coyier from <a rel="nofollow" href="http://css-tricks.com/">CSS-Tricks</a> built this <a rel="nofollow" href="http://css-tricks.com/anythingslider-jquery-plugin/">really cool jQuery plugin</a> that creates a content slider that will support any regular HTML in the slides. This is cool because many sliders I have used had limitations on what could be on the slides and did not offer many of the featuers the AnythingSlider does.</p>
<div id="attachment_369" class="wp-caption aligncenter" style="width: 560px"><img class="size-full wp-image-369" title="slider" src="http://davecavins.com/wp-content/uploads/2009/12/slider.gif" alt="AnythingSlider in SharePoint" width="550" height="297" /><p class="wp-caption-text">AnythingSlider in SharePoint</p></div>
<h3>Setup</h3>
<p>To get this working in SharePoint you will need to make sure you have a reference to jQuery in the page somewhere as well as a list for the slider to read from. For my example I am using an out of the box annoucements list.  You will also need the files for the plugin <a rel="nofollow" href="http://css-tricks.com/examples/AnythingSlider.zip" title="Anything Slider Download">download the anythingSlider plugin from css-tricks.com.</a></p>
<ul>
<li>In SharePoint Designer add a dataview webpart to the page with any field from your annoucements list.</li>
<li>Switch to code view and find the first &lt;xsl&gt; tag. It should be right after the closing &lt;DatasSources&gt; tag. </li>
<li>Right click on the tag and choose &#8220;Select Tag&#8221;. Press delete, don&#8217;t worry we will be adding in our own xsl.</li>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-368" title="xsl" src="http://davecavins.com/wp-content/uploads/2009/12/xsl.jpg" alt="Select the auto generated xsl" width="218" height="216" /></p>
<li>Paste the following xsl into the page where you deleted the code.</li>
<pre class="brush: xml;">
&lt;Xsl&gt;
&lt;xsl:stylesheet xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; version=&quot;1.0&quot; exclude-result-prefixes=&quot;xsl msxsl ddwrt&quot; xmlns:ddwrt=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/runtime&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; xmlns:msxsl=&quot;urn:schemas-microsoft-com:xslt&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot; xmlns:ddwrt2=&quot;urn:frontpage:internal&quot;&gt;
	&lt;xsl:output method=&quot;html&quot; indent=&quot;no&quot;/&gt;
	&lt;xsl:decimal-format NaN=&quot;&quot;/&gt;
	&lt;xsl:param name=&quot;dvt_apos&quot;&gt;&amp;apos;&lt;/xsl:param&gt;
	&lt;xsl:variable name=&quot;dvt_1_automode&quot;&gt;0&lt;/xsl:variable&gt;
	&lt;xsl:template match=&quot;/&quot; xmlns:x=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:d=&quot;http://schemas.microsoft.com/sharepoint/dsp&quot; xmlns:asp=&quot;http://schemas.microsoft.com/ASPNET/20&quot; xmlns:__designer=&quot;http://schemas.microsoft.com/WebParts/v2/DataView/designer&quot; xmlns:SharePoint=&quot;Microsoft.SharePoint.WebControls&quot;&gt;
		&lt;xsl:call-template name=&quot;dvt_1&quot;/&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1&quot;&gt;
		&lt;xsl:variable name=&quot;Rows&quot; select=&quot;/dsQueryResponse/Rows/Row&quot; /&gt;
		    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/page.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/slider.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery.easing.1.2.js&quot;&gt;&lt;/script&gt; &lt;script src=&quot;js/jquery.anythingslider.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt; &lt;script type=&quot;text/javascript&quot;&gt;
        function formatText(index, panel) {
		  return index + &amp;quot;&amp;quot;;
	    }
        $(function () {
            $(&amp;apos;.anythingSlider&amp;apos;).anythingSlider({
                easing: &amp;quot;easeInOutExpo&amp;quot;,
                autoPlay: true,
                delay: 3000,
                startStopped: false,
                animationTime: 600,
                hashTags: true,
                buildNavigation: true,
         	pauseOnHover: true,
     	startText: &amp;quot;Go&amp;quot;,
     	stopText: &amp;quot;Stop&amp;quot;,
	navigationFormatter: formatText
            });
            $(&amp;quot;#slide-jump&amp;quot;).click(function(){
                $(&amp;apos;.anythingSlider&amp;apos;).anythingSlider(6);
            });
        });
    &lt;/script&gt;
&lt;div class=&quot;anythingSlider&quot;&gt;
	&lt;div class=&quot;wrapper&quot;&gt;
		&lt;ul&gt;
		&lt;xsl:call-template name=&quot;dvt_1.body&quot;&gt;
			&lt;xsl:with-param name=&quot;Rows&quot; select=&quot;$Rows&quot; /&gt;
			&lt;/xsl:call-template&gt;
		&lt;/ul&gt;
		    &lt;/div&gt;
        &lt;/div&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.body&quot;&gt;
		&lt;xsl:param name=&quot;Rows&quot; /&gt;
		&lt;xsl:for-each select=&quot;$Rows&quot;&gt;
			&lt;xsl:call-template name=&quot;dvt_1.rowview&quot; /&gt;
		&lt;/xsl:for-each&gt;
	&lt;/xsl:template&gt;
	&lt;xsl:template name=&quot;dvt_1.rowview&quot;&gt;
		&lt;li&gt;
		&lt;div class=&quot;textSlide&quot;&gt;
&lt;!-- display the item title and a link to the item --&gt;
&lt;h3&gt;&lt;a href=&quot;/{@FileDirRef}/DispForm.aspx?ID={@ID}&quot; title=&quot;{@Title}&quot;&gt;&lt;xsl:value-of select=&quot;@Title&quot; /&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;!-- display the body of the item  --&gt;
	&lt;xsl:value-of select=&quot;@Body&quot; disable-output-escaping=&quot;yes&quot; /&gt;
	&lt;/div&gt;
	&lt;/li&gt;&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
&lt;/Xsl&gt;
</pre>
<li><strong>Important:</strong> Adjust the links on the code so that point to your local copies of the css easing and plugin files.</li>
</ul>
<h3>Notes</h3>
<p> I made a few small changes in the css file to make things work better with SharePoint.  In page.css file I deleted several of the classes so they would not interfere with SharePoint&#8217;s styles.  In the xsl I used a div with a class of  .textslide to wrap the content so I had to change that in page.css as well.  To keep long annoucements from breaking the design I set the overflow on the .textslide div to hidden. Below is the code I used in page.css.  </p>
<pre class="brush: css;">
/*hide content that is too long */
.textSlide { padding: 10px 30px; overflow:hidden; }
.textSlide h3  { font: 20px Georgia, Serif; margin-bottom:12px; }
.textSlide h4  { text-transform: uppercase; font: 15px Georgia, Serif; margin: 10px 0; }
.textSlide ul  { list-style: disc; margin: 0 0 0 25px; }
.textSlide ul li  { display: list-item; }
</pre>
<p> I did not make any changes to slider.css. It may be easier to just combine the tow files to keep things simple and reduce page load times.</p>
<h3>Conclusion</h3>
<p>The AnythingSlider plugin is lightweight, powerful and easy to customize.  Adding this type of functionality that is common on regular websites to a SharePoint site can help guide users to important information and of course make your site &#8216;cooler&#8217; than the average SharePoint site. </p>
<p>The code above just shows all the items in the list but once you have it working it is easy to add your own sort/filter parameters to the data view so only certain items are shown. </p>
<p>The slider could also be implemented to run off of the SharePoint list web service <a href="http://davecavins.com/2009/07/annoucement-slider-using-web-services/" target="_blank" title="Annoucements Slider using SP Web Services">the same way I did in this post</a>.  If you have any questions or comments feel free to post.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/anything-slider-in-sharepoint-update/' rel='bookmark' title='Permanent Link: Anything Slider in SharePoint &#8211; Update'>Anything Slider in SharePoint &#8211; Update</a></li>
<li><a href='http://davecavins.com/2010/01/displaying-a-rotating-header-image-with-caption/' rel='bookmark' title='Permanent Link: Displaying a rotating header image with caption'>Displaying a rotating header image with caption</a></li>
<li><a href='http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/' rel='bookmark' title='Permanent Link: Dynamic Drive&#8217;s Featured Content Slider in Sharepoint'>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/12/css-tricks-anythingslider-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Updating the People Picker</title>
		<link>http://davecavins.com/2009/12/updating-the-people-picker/</link>
		<comments>http://davecavins.com/2009/12/updating-the-people-picker/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 21:25:04 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[pre-populate]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=304</guid>
		<description><![CDATA[So I was working with a friend on a custom SharePoint list. When users create a new item certain fields needed to automatically populate with information from their profile. We ran into issues when trying to populate the people picker. Scripts like SPFF can be used to accomplish this but we needed something else because [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/06/corasworks-essentials-training/' rel='bookmark' title='Permanent Link: CorasWorks Essentials Training'>CorasWorks Essentials Training</a></li>
<li><a href='http://davecavins.com/2010/01/improving-sharepoint-forms/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms'>Improving #SharePoint Forms</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So I was working with a friend on a custom SharePoint list. When users create a new item certain fields needed to automatically populate with information from their profile. We ran into issues when trying to populate the people picker.</p>
<p>Scripts like SPFF can be used to accomplish this but we needed something else because we wanted to read in the current user&#8217;s information from the SharePoint web service. Additionally we wanted to avoid passing information using the query string because users would be able to access the form through multiple links.<br />
<div id="attachment_363" class="wp-caption alignnone" style="width: 410px"><img class="size-full wp-image-363" title="picker" src="http://davecavins.com/wp-content/uploads/2009/12/picker.jpg" alt="People Picker" width="400" height="37" /><p class="wp-caption-text">People Picker</p></div></p>
<p>So to prefill the form with some information we used a simple jQuery script in a Content Editor Web Part on the NewItem.aspx page. Initially we tried to target the input by using its title. This did not work so I looked at the code of the page using FireBug. It turns out that the field is actually a hidden textarea and what you see on the screen is actually just a div with a class of ms-inputuserfield. Here is part of the code we used to populate the people picker.</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot;&gt;
var user = &quot;dcavins&quot;
$(document).ready(function() {
$('div.ms-inputuserfield').text(user);
});
&lt;/script&gt;
</pre>
<p>This script can used along with the SP web services to prepopulate the people picker and other fields of a list. This is useful if you have a contacts list where you want people to be able to add themselves or a task list where users are supposed to assign items to themselves. Prepopulating fields makes it easier for the user saving them time.</p>
<p>The Rich Text Field is similar to the people picker in that it also hides the actual textarea and uses a div instead. In a later post I will explain how to use the web service to prepopulate list fields with information from the current users profile.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/06/corasworks-essentials-training/' rel='bookmark' title='Permanent Link: CorasWorks Essentials Training'>CorasWorks Essentials Training</a></li>
<li><a href='http://davecavins.com/2010/01/improving-sharepoint-forms/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms'>Improving #SharePoint Forms</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/12/updating-the-people-picker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint Vertical News Ticker</title>
		<link>http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/</link>
		<comments>http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 20:22:46 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Endusersharepoint]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[ticker]]></category>
		<category><![CDATA[webparts]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=341</guid>
		<description><![CDATA[On a recent project I needed to create a simple news ticker do display announcements from a SharePoint list. It was easy to do because I just used some of the code from the announcements slider I built a while back so I did not bother to write a post about it. Yesterday I saw [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-349 alignright" title="ticker1" src="http://davecavins.com/wp-content/uploads/2009/11/ticker1.jpg" alt="ticker1" width="197" height="433" />On a recent project I needed to create a simple news ticker do display announcements from a SharePoint list. It was easy to do because I just used some of the code from the <a href="http://davecavins.com/2009/07/annoucement-slider-using-web-services">announcements slider</a> I built a while back so I did not bother to write a post about it. Yesterday I saw <a href="http://www.endusersharepoint.com/2009/11/13/scrolling-news-aggregator-in-sharepoint/" target="_blank">a post on EndUserSharePoint.com</a> about how to setup something similar so I figured I would share my (cheaper) solution.</p>
<p>A few features of the ticker:</p>
<ul>
<li>The ticker pulls its contents from the default SharePoint Announcements list using jQuery.</li>
<li>The title of the announcement links to the display form for the item</li>
<li>Ticker pauses on mouseover</li>
<li>For each Announcement the first 500 characters are shown as an intro.</li>
</ul>
<p>Here is the code it can just be pasted in a content editor web part. The only dependency is jQuery. The code for the ticker came from <a href="http://net.tutsplus.com/tutorials/javascript-ajax/build-a-simple-jquery-news-ticker/" target="_blank">this post on Net Tuts Plus</a>. I removed the comments but you can see the <a href="http://net.tutsplus.com/tutorials/javascript-ajax/build-a-simple-jquery-news-ticker/" target="_blank">commented code and an explanation here</a>.<br />
<span id="more-341"></span></p>
<pre class="brush: plain;">
&lt;script type=&quot;text/javascript&quot; src=&quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
  &lt;script type=&quot;text/javascript&quot; src=&quot;ticker.js&quot;&gt;&lt;/script&gt;
	&lt;script type=&quot;text/javascript&quot;&gt;
       $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Announcements&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='Body' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
								&lt;FieldRef Name='FileDirRef' /&gt; \
								&lt;FieldRef Name='Created' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;

        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });

    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
        	var teaser = $(this).attr(&quot;ows_Body&quot;);
        	var teaserText = teaser.slice(0,500);
        	var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
			var urlArray;
			var urlName;
			     if (urlValue == undefined)
	    	{
      		urlName = &quot;&quot;;
        	}
        	else {
        		urlArray = urlValue.split(&quot;;#&quot;);
        		urlName= urlArray[1];
        	}     	

            var liHtml = &quot;&lt;dt class='newsItem'&gt;&lt;a href='/&quot; + urlName + &quot;/Dispform.aspx?ID=&quot; + $(this).attr(&quot;ows_ID&quot;) + &quot;'&gt;&quot;
            + $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;&quot; + teaserText + &quot;&lt;/p&gt;&lt;/dd&gt;&quot;;
            $(&quot;#ticker&quot;).append(liHtml);
        });
	$(function() {
		var ticker = $(&quot;#ticker&quot;);
		ticker.children().filter(&quot;dt&quot;).each(function() {
		  var dt = $(this),
		    container = $(&quot;&lt;div&gt;&quot;);
		  dt.next().appendTo(container);
		  dt.prependTo(container);
		  container.appendTo(ticker);
		});
		ticker.css(&quot;overflow&quot;, &quot;hidden&quot;);
		function animator(currentItem) {
		  var distance = currentItem.height();
			duration = (distance + parseInt(currentItem.css(&quot;marginTop&quot;))) / 0.025;
		  currentItem.animate({ marginTop: -distance }, duration, &quot;linear&quot;, function() {
			currentItem.appendTo(currentItem.parent()).css(&quot;marginTop&quot;, 0);
			animator(currentItem.parent().children(&quot;:first&quot;));
		  });
		};
		animator(ticker.children(&quot;:first&quot;));
		ticker.mouseenter(function() {
		  ticker.children().stop();
		});
		ticker.mouseleave(function() {
		  animator(ticker.children(&quot;:first&quot;));
		});
	  });
        }
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
#ticker {
  width:180px; height:420px; overflow:auto; border:1px solid #aaaaaa;
}
#ticker dt {
  font:normal 14px Georgia; padding:0 10px 5px 10px;
  background:#e5e5e5 url('/_layouts/images/keyword.gif') no-repeat left 60%; padding-top:10px; padding-left:22px;
  border:1px solid #ffffff; border-bottom:none; border-right:none;
}
#ticker dd {
  margin-left:0; font:normal 11px Verdana; padding:0 10px 10px 10px;
  border-bottom:1px solid #aaaaaa; background-color:#e5e5e5;
  border-left:1px solid #ffffff;
}
#ticker dd.last { border-bottom:1px solid #ffffff;  }
#ticker div { margin-top:0; }
&lt;/style&gt;

&lt;div class=&quot;myclass&quot;&gt;
		&lt;dl id=&quot;ticker&quot;/&gt;
&lt;/div&gt;
</pre>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Image Slideshow with captions</title>
		<link>http://davecavins.com/2009/11/slideshow-with-captions/</link>
		<comments>http://davecavins.com/2009/11/slideshow-with-captions/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 17:12:01 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[webparts]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=245</guid>
		<description><![CDATA[This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs.  Setup To get this [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs. </p>
<div id="attachment_331" class="wp-caption aligncenter" style="width: 464px"><img class="size-full wp-image-331" title="slideshow" src="http://davecavins.com/wp-content/uploads/2009/10/slideshow.jpg" alt="Slide show with captions" width="454" height="301" /><p class="wp-caption-text">Slide show with captions</p></div>
<p><span id="more-245"></span></p>
<h2>Setup</h2>
<p>To get this slideshow up and running there are a few things we have to do to prepare.</p>
<ol>
<li>Create a standard image library.  You can add additional fields if needed but the list needs to have all of the out of the box fields.</li>
<li><a href="http://jquery.com" target="_blank" rel="nofollow">Get jQuery</a>.  Either link to the <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" target="_blank" rel="nofollow">latest version from Google</a> or download it and put it in a location on your server.</li>
<li><a href="http://www.serie3.info/s3slider/index.php" target="_blank">Download the s3 slider plugin</a> and put it somewhere on your server.</li>
</ol>
<h2>Querying the SharePoint List</h2>
<p>I am using the <a href="http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx" rel="nofollow" target="_blank">techniques described by Jan Tielnes</a> for querying SP lists with javascript.  Here is the code.</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;Scripts/jquery-1[1].3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;Scripts/s3Slider.js
&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Pictures&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='FileDirRef' /&gt; \
                               &lt;FieldRef Name='NameOrTitle' /&gt; \
                               &lt;FieldRef Name='FileRef' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
                               &lt;FieldRef Name='Description' /&gt; \
                               &lt;FieldRef Name='FileType' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;
        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });
    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
            var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
                                                var urlArray;
                                                var urlName;
                                                     if (urlValue == undefined)
                                {
                                urlName = &quot;- - -&quot;;
                }
                else {
                                urlArray = urlValue.split(&quot;;#&quot;);
                                urlName= urlArray[1];
                }
                                                var thumbUrl = $(this).attr(&quot;ows_NameOrTitle&quot;);
                                                var thumbArray;
                                                var thumb;          

                                                     if (thumbUrl == undefined)
                                {
                                thumb = &quot;- - -&quot;;
                }
                else {
                                thumbArray = thumbUrl.split(&quot;.&quot;);
                                thumb= thumbArray[0];
                }
            var liHtml = &quot;&lt;li class='s3sliderImage'&gt;&lt;img src='/&quot; + urlName + &quot;/_w/&quot; + thumb +&quot;_&quot; + $(this).attr(&quot;ows_FileType&quot;) + &quot;.jpg'/&gt;&lt;span&gt;&lt;a href='&quot; + urlName + thumb + &quot;.&quot; + $(this).attr(&quot;ows_FileType&quot;) + &quot;'&gt;View Larger&lt;/a&gt;&lt;h3&gt;&quot; + $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/h3&gt;&quot; + $(this).attr(&quot;ows_Description&quot;) + &quot;&lt;/span&gt;&lt;/li&gt;&quot;;
            $(&quot;#s3sliderContent&quot;).append(liHtml);
        });
        $('#s3slider').s3Slider({timeOut: 4000 });
}
&lt;/script&gt;
&lt;div id=&quot;s3slider&quot; &gt;
   &lt;ul id=&quot;s3sliderContent&quot; /&gt;
&lt;/div&gt;
</pre>
<h3>Configuring the query.</h3>
<p>In the code above I am querying a list named &#8216;Pictures&#8217; and returning the title, link to the file, file name, file type, description and the ID. To change the name of the list just update this tag with the appropriate list name.</p>
<pre class="brush: plain;">&lt;listName&gt;Name of the List you want to use&lt;/listName&gt;</pre>
<p><strong>Note:</strong> If you have renamed a default Image library the name may not have actually changed from SharePoint&#8217;s perspective so double check by browsing to the list and reading the URL string.</p>
<p>If you want to include data from other fields in the html output just add the field names to the &#8216;ViewFields&#8217; section of the soap envelope.</p>
<pre class="brush: plain;"> &lt;FieldRef Name='NameOfField' /&gt; \</pre>
<p>You will also need to add a reference to the field in the &#8216;liHtml&#8217; variable. When referencing fields in the variable remember to put &#8216;ows_&#8217; in front of the field name.</p>
<p>Remember the field name that is displayed through the SharePoint UI is not always the real field name.  In this post <a title="Find field names in SharePoint" rel="nofollow" href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx" target="_blank">Heather Solomon describes a good way to find the real field names</a>.</p>
<h2>The CSS</h2>
<p>I made a few changes to the CSS to set the size of the slideshow and the colors and fonts for the captions</p>
<pre class="brush: css;">
 #s3slider {width: 450px; height: 300px; position: relative; overflow: hidden; border:1px solid #666;}
#s3sliderContent {width: 450px; position: absolute; top: 0; margin-left: 0;}
.s3sliderImage {float: left; position: relative; display: none;}
.s3sliderImage span {
   position: absolute;
   left: 0;
   font: 10px/15px Arial, Helvetica, sans-serif;
   padding: 5px 13px;
   width: 449px;
   background-color: #fff;
   filter: alpha(opacity=70);
   -moz-opacity: 0.7;
   -khtml-opacity: 0.7;
   opacity: 0.7;
   color: #000;
   display: none;
   top: 0;
}
.s3sliderImage span h3{margin:1px;	padding:1px; font:normal italic 18px/14px Georgia, serif;}
.s3sliderImage span a{float:right;color:#fff;background:#333;padding:2px;text-decoration:none;margin-top:5px;}
.clear {clear: both;}
</pre>
<p><a href="http://davecavins.com/wp-content/uploads/2009/11/ImageSlideShowWithCaptions.dwp" target="_blank" rel="nofollow">Download all the the code in a .dwp here</a></p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Permanent Link: Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/slideshow-with-captions/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Resizable textareas in SharePoint edit forms</title>
		<link>http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/</link>
		<comments>http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 15:01:21 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[textarea]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=290</guid>
		<description><![CDATA[So one of the things that I have had end users complain to me about is the size of the text boxes on the new and edit forms of lists like the contacts list and announcement list. On a recent non-SharePoint project I used a jQuery plugin to create a resizable text area so I [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2010/02/improving-sharepoint-forms-hints/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Hints'>Improving #SharePoint Forms &#8211; Hints</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>So one of the things that I have had end users complain to me about is the size of the text boxes on the new and edit forms of lists like the contacts list and announcement list. On a recent non-SharePoint project I used a jQuery plugin to create a resizable text area so I tried to implement it in SharePoint. Here is what happened.</p>
<p>I downloaded the <a title="Textarea Resize" rel="nofollow" href="http://viralpatel.net/blogs/2009/06/textarea-resize-javascript-jquery-plugin-resize-textarea-html.html">Textarea Resize JavaScript</a> jQuery plugin, saved in a SharePoint library along with the latest version of jQuery.</p>
<h3>Selecting the Element</h3>
<p>In order for the jQuery code to work it has to know which elements on the page you want to work with.</p>
<p>Here is the code SharePoint renders for a text box:</p>
<pre class="brush: xml;">
&lt;textarea name=&quot;ctl00$m$g_3fa2cde8_0ea8_4421_814f_6a6d292fbe54$ctl00
$ctl04$ctl0ctl00$TextField&quot;
rows=&quot;15&quot;
cols=&quot;20&quot; id=&quot;ctl00_m_g_3fa2cde8_0ea8_4421_ctl00_TextField&quot; title=&quot;Body&quot;
class=&quot;ms-long&quot; dir=&quot;none&quot;&gt;&lt;/textarea&gt;
</pre>
<p>There are two problems:</p>
<ol>
<li> ASP.NET creates very long and hard to use IDs</li>
<li>The class ms-long culd apply to other elements on the page that I dont want to use the effect on.</li>
</ol>
<p><span id="more-290"></span><br />
So all we have left to use is the title attribute. With jQuery we can select elements based on thier title. There are <a title="jQuery Selectors" rel="nofollow" href="http://docs.jquery.com/Selectors" target="_blank">more details on using jQuery selectors</a> on the jQuery website. To select our text box with the title &#8220;Simple Text&#8221; we use the following code:</p>
<pre class="brush: jscript;">
$('textarea[title=&quot;Simple Text&quot;]')
</pre>
<p>A quick way to check and be sure your selector is working is to call the addClass function in jQuery and change the background color or border color of the element.</p>
<p style="text-align: center;"><img class="size-full wp-image-293 aligncenter" title="grippie" src="http://davecavins.com/wp-content/uploads/2009/10/grippie.jpg" alt="grippie" width="412" height="157" /></p>
<h3>Trial and Error</h3>
<p>So after I verified the selector was working I applied the plugin but nothing happened. After some testing I realized the script would not work on the rich text box because SharePoint has a JavaScript that runs to initialize the WYSIWYG editor. I am still experimenting so if I get it working on the rich text field I will post and update. For now it only works with the plain text field.</p>
<p>Here is the code I used:</p>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript&quot; src=&lt;a href=&quot;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&quot;&gt;http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js&lt;/a&gt;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;scripts/jquery.textarearesizer.compressed.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
	/* jQuery textarea resizer plugin usage */
	$(document).ready(function() {
	$('textarea[title=&quot;Title of your field&quot;]').TextAreaResizer();
			});
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
div.grippie {
	background:#EEEEEE url(grippie.png) no-repeat scroll center 2px;
	border-color:#DDDDDD;
	border-style:solid;
	border-width:0pt 1px 1px;
	cursor:s-resize;
	height:9px;
	overflow:hidden;
	}
.resizable-textarea textarea {
	display:block;
	margin-bottom:0pt;
	}
&lt;/style&gt;
</pre>
<p>I just put the code in a content editor webpart on the EditFomr.aspx and NewForm.aspx pages.  To add the CEWP to the page just add &#8220;&amp;ToolPaneView=2&#8243; to the end of the url to get the toolbar.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/02/character-count-on-sharepoint-fields/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Character Count'>Improving #SharePoint Forms &#8211; Character Count</a></li>
<li><a href='http://davecavins.com/2010/05/improving-sharepoint-forms-%e2%80%93-watermarks/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms – Watermarks'>Improving #SharePoint Forms – Watermarks</a></li>
<li><a href='http://davecavins.com/2010/02/improving-sharepoint-forms-hints/' rel='bookmark' title='Permanent Link: Improving #SharePoint Forms &#8211; Hints'>Improving #SharePoint Forms &#8211; Hints</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/resizable-textarea-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Adding Suggestions to the Sharepoint search box : Part 2</title>
		<link>http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/</link>
		<comments>http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 16:07:37 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[suggestions]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=233</guid>
		<description><![CDATA[In Part 1 of this post we used a simple javascript to display suggestions on a custom search box. After I wrote that post I was thinking it would make more sense to read the suggestions from a list instead of a JavaScript file. This post will explain how to setup the list and edit [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box'>Adding Suggestions to the Sharepoint search box</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/">In Part 1 of this post</a> we used a simple javascript to display suggestions on a custom search box. After I wrote that post I was thinking it would make more sense to read the suggestions from a list instead of a JavaScript file. This post will explain how to setup the list and edit the JavaScript to read the suggestions from a list. The idea is that an administrator could manage the list and help guide users toward specific information instead of getting numerous un-related results like in <a href="http://www.youtube.com/watch?v=i1AwFY6MuwE" target="_blank">those commercials for bing</a>.</p>
<p>Assuming you already have the search box setup as described in <a href="http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/">Part one of this post</a> all you will need to do is change the javascript and add some code to the page.</p>
<h2>Setup</h2>
<ul>
<li>Do everything from the first post</li>
<li>Add a link to jQuery somewhere on the page.</li>
<li>Create a custom list called &#8216;Suggestions&#8217;. It just needs to have the default title field. Create at least one item in the list and in the title enter several comma separated words.</li>
<li>Add the code below to the page.</li>
</ul>
<pre class="brush: jscript;">
&lt;script type=&quot;text/javascript” src=“http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js”&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function GetItemsFromSP() {
    var soapEnv =
 “&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Suggestions&lt;/listName&gt; \
                        &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;”;
       $.ajax({
        url: “_vti_bin/lists.asmx”,
        type: “POST”,
        dataType: “xml”,
        data: soapEnv,
        complete: processResult,
        contentType: “text/xml; charset=\”utf-8\”“,
        async: false
    });
}
function processResult(xData, status) {
    $(xData.responseXML).find(“z\\:row”).each(function() {
        $(“#data”).append(“” + $(this).attr(“ows_Title”) + “,”);
    });
}
&lt;/script&gt;
&lt;script type=“text/javascript” src=“Resources/searchfield.js”&gt;&lt;/script&gt;
&lt;div style=“display:none; visibility:hidden” id=“data”&gt;&lt;/div&gt;
</pre>
<p>The code above get the items from the Suggestions list, seperates them with commas and puts them in a hidden div with an ID of data. Now we just need to edit the searchfield script to read in the information from our hidden div. To do this edit searchfield.js line 26 to call the GetItemsFromSP function and set the suggestionText variable to be equal to the contents of our hidden div. Here is the code.</p>
<pre class="brush: jscript;">
/**/*/*/*/**/
	GetItemsFromSP();
	var suggestionText =  $(“#data”).html();
</pre>
<p>Test the page and make sure it works by typing the first few letters of one of the words in you list item.</p>
<h2>Conclusion</h2>
<p>This is very similar to <a href="http://weblogs.asp.net/jan/archive/2009/07/02/sharepoint-search-as-you-type-with-jquery.aspx">Jan Tielens&#8217; SharePoint Search-as-You-Type with jQuery solution </a>but I wanted the search box to still be usable even if there are no suggestions. In Jan&#8217;s solution the &#8216;search box&#8217; does not actually do anything when the magnifying glass is clicked. There are likely better ways to do this and if you know of one please post a comment.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/04/adding-suggestiong-to-the-sharepoint-search-box/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box'>Adding Suggestions to the Sharepoint search box</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Annoucements Slider using SP Web Services</title>
		<link>http://davecavins.com/2009/07/annoucement-slider-using-web-services/</link>
		<comments>http://davecavins.com/2009/07/annoucement-slider-using-web-services/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 17:00:12 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=146</guid>
		<description><![CDATA[This is a simple news slider I put together using SharePoint web services, jQuery and the Easy Slider Plugin from CSS Globe. You can get the plugin here. The Web Part points to the local site&#8217;s Annoucements list and display the title, body and a link to view the item. The jQuery connection to the [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a simple news slider I put together using SharePoint web services, jQuery and the Easy Slider Plugin from CSS Globe. You can <a href="http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding" target="_blank">get the plugin here</a>. The Web Part points to the local site&#8217;s Annoucements list and display the title, body and a link to view the item. The jQuery connection to the SharePoint web service is based on code from <a href="http://weblogs.asp.net/jan/default.aspx" target="_blank">Jan Tielens</a>.</p>
<p><img class="aligncenter" src="http://davecavins.com/wp-content/uploads/2009/07/slider.jpg" alt="" width="500" height="232" /></p>
<p><span id="more-146"></span></p>
<h2>Installation</h2>
<p><strong>4 simple steps.</strong></p>
<ol>
<li>Paste the code below into a Content Editor Web Part (CEWP) on your page.</li>
<li>Change the link to jQuery if needed. The code references the jQuery library on Google Code so if you are working in an isolated environment or already have jQuery on your server just change the link (its on the first line).</li>
<li>Put the Easy Slider code in a document library and adjust the link to it on the second line of the code.</li>
<li>Update the CSS to match your site (The CSS can be moved to an external file or added to your custom theme).</li>
</ol>
<h2>Code</h2>
<p><a href="http://davecavins.com/wp-content/uploads/2009/07/AnnouncementsSlider.dwp" target="_blank">Download the .dwp here</a></p>
<pre class="brush: plain;">
/*Link to jQuery change this to point to where you have the jQuery files */
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
/*Change this to point to the plugin file on your sever */
&lt;script type=&quot;text/javascript&quot; src= js/easySlider1.5.js&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
       $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Announcements&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='Body' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
				&lt;FieldRef Name='FileDirRef' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;

        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });

    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
        	var teaser = $(this).attr(&quot;ows_Body&quot;);
        	var teaserText = teaser.slice(0,500);
        	var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
			var urlArray;
			var urlName;
			     if (urlValue == undefined)
	    	{
      		urlName = &quot;- - -&quot;;
        	}
        	else {
        		urlArray = urlValue.split(&quot;;#&quot;);
        		urlName= urlArray[1];
        	}

            var liHtml = &quot;&lt;li&gt;&lt;h5&gt;&quot;	+ $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/h5&gt;&lt;p&gt;&quot; + teaserText +
            &quot;&lt;br/&gt;&lt;a class='readMore' href='/&quot; + urlName + &quot;/Dispform.aspx?ID=&quot; + + $(this).attr(&quot;ows_ID&quot;) + &quot;'&gt;Read More&lt;a/&gt;&lt;/p&gt;&lt;/li&gt;&quot;;
            $(&quot;#tasksUL&quot;).append(liHtml);
        });
        $(&quot;#slider&quot;).easySlider({
			controlsBefore:	'&lt;div id=&quot;controls2&quot;&gt;',
			controlsAfter:	'&lt;/div&gt;',
			auto: true,
			continuous: true,
			//vertical: true,
			prevText: '&lt; Prev',
			nextText: 'Next &gt;',
			speed: 1000,
			pause: 4000
			});
        }
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
#slider{font-size:x-small; background:#E2EFFF;}
#slider h5{padding:5px; font-size:small; color:#315F9B; letter-spacing:-1px; line-height:20px;margin:0px;}
#slider div {font-size: x-small; padding:0px; margin:3px;}
#slider ul, #slider li{margin:0; padding:0; list-style:none;}
#slider li{width:600px;	height:241px; overflow:hidden; padding:0px;}
#controls2 {padding:3px 0 0 0; text-align:right; width:600px;}
.readMore {margin:3px;padding:2px;background:#F7FBFF;}
#prevBtn, #nextBtn{}
#nextBtn{}
#prevBtn a, #nextBtn a{font-size:x-small;}
#nextBtn a{}
&lt;/style&gt;
   	&lt;div id=&quot;slider&quot;&gt;
		&lt;ul id=&quot;tasksUL&quot;/&gt;
	&lt;/div&gt;
</pre>
<h2>Enjoy</h2>
<p><strong>Notes</strong><br />
Announcements with really long bodies will get cut off because the div that holds the contents has a fixed height. This can be adjusted in the CSS. Long titles could also cause a problem if they wrap to multiple lines. One other thing to watch out for is inline styles applied by the WYSIWYG editor on the body of the announcement. They can override the default styles and cause items to look different.</p>
<p><strong>Changing whats displayed</strong><br />
To change which fields are displayed edit the section and add a tag for the fields you want to reference. If you have customized your list or renamed fields the names that appear on the column headings and on the list settings page may not be correct. The fastest way to find the real name of a field is to go to the list settings page and click on the name of the column to edit it. On the edit page look at the very end of the URL and it will say Field=[real name of your field].</p>
<p>Once you have edited the added the all you need to do is edit the liHtml var to include the new field in the output html. To show the field just use this $(this).attr(&#8220;ows_MyFieldName&#8221;).</p>
<p><strong>Upate</strong><br />
New Stlyes for the slider. A little less grey and will match better with a default SharePoint theme</p>
<pre class="brush: css;">&lt;style type=&quot;text/css&quot;&gt;
#slider{font-size:x-small; background:#E2EFFF;}
#slider h5{padding:5px; font-size:small; color:#315F9B;
letter-spacing:-1px; line-height:20px;margin:0px;}
#slider div {font-size: x-small; padding:0px; margin:3px;}#slider ul, #slider li{margin:0; padding:0; list-style:none;}#slider li{width:600px;	height:241px; overflow:hidden; padding:0px;}#controls2 {padding:3px 0 0 0; text-align:right; width:600px;}.readMore {margin:3px;padding:2px;background:#F7FBFF;}#prevBtn, #nextBtn{}#nextBtn{}#prevBtn a, #nextBtn a{font-size:x-small;}#nextBtn a{}&lt;/style&gt;</pre>
<p><strong>Conclusion</strong><br />
This is very basic but provides some nice functionality and can be easily styled to match your site. Because it uses the web service instead of a data view webpart it is portable and will work on any site with an announcements list. With some more work on the JavaScript it would be simple to limit the amount of text from the body that is displayed.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Permanent Link: Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Permanent Link: Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/07/annoucement-slider-using-web-services/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>A Faster jQuery Preview Pane</title>
		<link>http://davecavins.com/2009/07/a-faster-jquery-preview-pane/</link>
		<comments>http://davecavins.com/2009/07/a-faster-jquery-preview-pane/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 19:49:50 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[Endusersharepoint]]></category>
		<category><![CDATA[Gabe Hilado]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=144</guid>
		<description><![CDATA[A while back there was a post on EndUserSharePoint.com by Paul Grenier that described how to use jQuery and the CEWP to make a preview pane.  I thought it was a very nice solution and worked better than the out of the box preview pane SharePoint uses.   Too Much Code The only issue is the preview [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
<li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 2'>Adding Comments to a List Part 2</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>A while back there was <a href="http://www.endusersharepoint.com/?p=1223" target="_blank">a post on EndUserSharePoint.com</a> by Paul Grenier that described how to use jQuery and the CEWP to make a preview pane.  I thought it was a very nice solution and worked better than the out of the box preview pane SharePoint uses.  </p>
<h3>Too Much Code</h3>
<p>The only issue is the preview pane solution is that in environments with slow internet connections the preview pane will be almost as slow as if the user actually broswed to the display form for the item.</p>
<p>Although its done through AJAX jQuery is still having to load the whole DispForm.aspx and then only displaying the contents of  a specific element.  DispForm.aspx when rendered through the borwser (like most pages in SharePoint) is very code heavy with over 700 lines of code ( An Announcement List item). Reducing the amount of code jQuery has to load from the diplay form will decrease load times and make everyone happy.</p>
<h3>Faster</h3>
<p><a href="http://www.spdeveloper.com" target="_blank">Gabe Hilado</a> and I decided to try to make it faster. The simple solution is to make your own diplay form in SharePoint Designer. First we tried creating a blank .aspx page and putting the list view webpart on it.  The reduced the amount of code on the page but I wanted it to be even faster.</p>
<p><span id="more-144"></span>The next step was to use a dataview webpart only displaying the fields we needed for the preview. The result was a page with under 100 lines of code (varies based on the item legnth). </p>
<p>Below is the modified javascript.</p>
<pre class="brush: jscript;">
&lt;script src=&lt;a href=&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&quot;&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js&lt;/a&gt;&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
function handleError() { //fn needed for IE
return true;
}
function jLoadMe(t) {//load content

$(&quot;#jLoadMe&quot;).load(t+&quot; .ms-formtable&quot;, function(result,status,xhr) {
$(&quot;#jLoadMe h3&quot;).css(&quot;font-size&quot;,&quot;8pt&quot;);
});
}
function initjLoadMe() {//initialize page
var arrayList = $(&quot;a[href*='DispForm.aspx']&quot;);
$.each(arrayList, function(i,e){
var t = $(e).attr(&quot;href&quot;);
t = t.replace('DispForm.aspx','empty.aspx');
$(e).hover(function() {jLoadMe(t)});
});
}
$(function() {
window.onerror = handleError; //needed for IE
initjLoadMe();
});
function jLoadEdit(t) {//load content
$(&quot;#jLoadMe&amp;quot;).load(t+&quot; .editForm&quot;,  function(result,status,xhr) {
$(&quot;#jLoadMe h3&quot;).css(&quot;font-size&quot;,&quot;8pt&quot;);

});
}
&lt;/script&gt;
&lt;div id=&quot;jLoadMe&quot; class=&quot;content&quot;&gt;&lt;/div&gt;
</pre>
<h3>What&#8217;s going on</h3>
<p>The code has been modified so that onhover instead of calling DispForm.aspx it calls empy.aspx. However when the item title is clicked the browser will nagivate to the traditional DispForm.aspx.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/04/switch-list-displays-with-jquery-and-css/' rel='bookmark' title='Permanent Link: Switch List Displays with JQuery and CSS'>Switch List Displays with JQuery and CSS</a></li>
<li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-2/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 2'>Adding Comments to a List Part 2</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='Permanent Link: SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/07/a-faster-jquery-preview-pane/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
