<?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; JavaScript</title>
	<atom:link href="http://davecavins.com/tag/javascript/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>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>Filter Lists by Date Range</title>
		<link>http://davecavins.com/2009/09/filter-by-date-range/</link>
		<comments>http://davecavins.com/2009/09/filter-by-date-range/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 14:06:42 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Data View Web Part]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=172</guid>
		<description><![CDATA[On a recent project one of the requirements was that users be able to filter a list by a date range.  To this I tried using two date filter webparts connected to a data view webpart.  A detailed description of how to set this up can be found here.  This solution worked well enough but there was a page [...]


Related posts:<ol><li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 1'>Adding Comments to a List Part 1</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/12/updating-the-people-picker/' rel='bookmark' title='Permanent Link: Updating the People Picker'>Updating the People Picker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>On a recent project one of the requirements was that users be able to filter a list by a date range.  To this I tried using two date filter webparts connected to a data view webpart.  A detailed description of how to set this up can be <a title="Filter between two dates (date range) with the Data view Webpart " href="http://yanlinglei.blogspot.com/2008/11/filter-between-two-dates-date-range.html" target="_blank">found here</a>.  This solution worked well enough but there was a page refresh after the user entered each date, so the user enters the first date (page refresh) user enters second date (page refresh again) and finally they get the results.  This annoyed me, I wanted to remove the extra page loads so I tried several things and this is what I finally came up with.</p>
<h3>Setup</h3>
<p>Using a content editor webpart build the form elements needed to collect the dates, two inputs and a search button.  Give each input a unique ID. Here is the code I used.</p>
<pre class="brush: jscript;">
&lt;script language=&quot;JavaScript&quot;&gt;
function submitForm()
{
var startDate = document.getElementById('startDate').value;
var endDate = document.getElementById('endDate').value;
window.parent.location=&quot;default.aspx?T1=&quot; + startDate + '&amp;T2=' + endDate;
}
&lt;/script&gt;
&lt;p&gt;&lt;div id=&quot;dateDiv&quot; style=&quot;display:none;&quot; class=&quot;filterBox&quot;&gt;
&lt;h4&gt;Date Search&lt;/h4&gt;
        Between
&lt;input name=&quot;startDate&quot; type=&quot;text&quot; id=&quot;startDate&quot; value=&quot;&quot; size=&quot;15&quot; class=&quot;dateformat-Y-ds-m-ds-d&quot; value=&quot;&quot;&gt;
and
&lt;input name=&quot;endDate&quot; type=&quot;text&quot; id=&quot;endDate&quot; value=&quot;&quot; size=&quot;15&quot; class=&quot;dateformat-Y-ds-m-ds-d&quot; value=&quot;&quot;&gt;
 YYYY-MM-DD
&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot;Go&quot;  onClick=&quot;submitForm();this.disabled=true;&quot;&gt;
&lt;/div&gt;
</pre>
<p>The class names are used to activate the date picker script but can be whatever you want. I used this <a href="http://www.frequency-decoder.com/demo/date-picker-v4/">date picker script from Frequecy Decoder</a></p>
<p>The submitForm() function simply takes the values from the inputs and adds them as query string variables at the end of the URL. We can now use these values to filter the list.</p>
<h3>Filtering the Data View Web part</h3>
<p>To filter the content of the DVWP based on the date we have to setup some parameters for the start and end dates.   Under &#8216;Common Data View Tasks&#8217; just choose &#8216;Parameters&#8217; for both the start and end date set the source as &#8216;Query String&#8217;. The query string variable will be whatever you defined in the JavaScript so in this case they are T1 and T2. Set the default value for the start date to some date impossibly far in the past and for the end date set it to something like the year 3000. This will ensure that the list will show all records if no values are passed for the start and end dates.</p>
<p><a href="http://davecavins.com/wp-content/uploads/2009/09/parameters.jpg"><img class="size-full wp-image-192 alignnone" title="parameters" src="http://davecavins.com/wp-content/uploads/2009/09/parameters.jpg" alt="parameters" width="506" height="338" /></a></p>
<p>Then all you have to do is setup your filter based on the parameters from the query string.</p>
<p><a href="http://davecavins.com/wp-content/uploads/2009/09/filter.jpg"><img class="aligncenter size-full wp-image-193" title="filter" src="http://davecavins.com/wp-content/uploads/2009/09/filter.jpg" alt="filter" width="446" height="269" /></a></p>
<p>You&#8217;re done.</p>
<h3>Things to remember</h3>
<p>The date has to be passed in YYYY-MM-DD format in order to work.</p>
<p>If the detault values for your start and end date parameters are not set high / low enough all records will not display when not date range is entered.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2010/03/adding-comments-to-a-list-part-1/' rel='bookmark' title='Permanent Link: Adding Comments to a List Part 1'>Adding Comments to a List Part 1</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/12/updating-the-people-picker/' rel='bookmark' title='Permanent Link: Updating the People Picker'>Updating the People Picker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/09/filter-by-date-range/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</title>
		<link>http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/</link>
		<comments>http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:39:56 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[content slider]]></category>
		<category><![CDATA[dynamic drive]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[SharePoint Designer]]></category>
		<category><![CDATA[xsl]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=11</guid>
		<description><![CDATA[I have used Dynamic Drive&#8217;s Featured Content Slider on a couple of recent projects and wanted to see if I could get it working in SharePoint. There were several key requirements: User can easily add items Users  can choose a style for each item Expired Items must not show Each item will have a Title, Body [...]


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/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>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I have used <a href="http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm" target="_blank">Dynamic Drive&#8217;s Featured Content Slider</a> on a couple of recent projects and wanted to see if I could get it working in SharePoint. There were several key requirements:</p>
<ol>
<li>User can easily add items</li>
<li>Users  can choose a style for each item</li>
<li>Expired Items must not show</li>
<li>Each item will have a Title, Body and a customizable &#8220;read more&#8221; link.</li>
</ol>
<p>Here&#8217;s how I did it.</p>
<p><img class="alignnone size-full wp-image-155" title="slider" src="http://davecavins.com/wp-content/uploads/2009/05/slider.jpg" alt="slider" width="596" height="242" /> </p>
<p>First I created a custom list to store the slider items.  These are the columns I used:</p>
<p>Title &#8211; Single Line of text<br />
Body &#8211; Multiple Lines of text<br />
Link URL &#8211; HyperLink<br />
Expiration &#8211; Date and Time (expired items will not be shown)<br />
Image &#8211; Picture<br />
Style &#8211; Choice  (we will use this column to allow users to choose the style of each item)</p>
<p>On the page I used a DataView WebPart to display the Title, Body, Image and Link URL columns.   Using Sharepoint Designer I setup filtering on the expiration date.  To do this in design view right click on the data view webpart and bring up the &#8220;Common Data View Tasks &#8221; box and choose Filter.  In the window I set the conditional statement so that items would only be shown if the expiration date was greater than today.<span id="more-11"></span></p>
<p>You can find a basic tutorial on using the DVWP <a href="http://www.endusersharepoint.com/?p=1629" target="_blank">here</a></p>
<p>Once we have the data we want showing on the page we need to get it into the right format.  For the Content Slider to work properly the page needs to refernce an external JavaScript file and a CSS style sheet. Additionally the Slider itself has to follow this pattern:</p>
<pre class="brush: xml;">
&lt;div id=&quot;slider1&quot; class=&quot;sliderwrapper&quot;&gt;
&lt;div class=&quot;contentdiv&quot;&gt;Content 1 Here.
&lt;/div&gt;
&lt;div id=&quot;paginate-slider1&quot; class=&quot;pagination&quot;&gt;&lt;/div&gt;
</pre>
<p>Basically the whole content slider has do be wrapped in a div with an ID of &#8216;slider1&#8242;  each of the items must be wrapped in a div with the class &#8216;contentdiv&#8217;.  For more explanation on this <a href="http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm" target="_blank">visit Dynamic Drive</a></p>
<p>SharePoint uses xsl to style the data view so we have to go into the code view and add the nessecary Javascript, CSS and div elements to make everything work. Here is the xsl I used to get everything working in the page</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;&amp;apos;&lt;/xsl:param&gt;
	&lt;xsl:param name=&quot;Today&quot;&gt;CurrentDate&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;div id=&quot;slider1&quot; class=&quot;sliderwrapper&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;/div&gt;
		&lt;div id=&quot;paginate-slider1&quot; class=&quot;pagination&quot;&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
featuredcontentslider.init({
	id: &quot;slider1&quot;,  //id of main slider DIV
	contentsource: [&quot;inline&quot;, &quot;&quot;],
	toc: &quot;#increment&quot;,  //Valid values: &quot;#increment&quot;, &quot;markup&quot;, [&quot;label1&quot;, &quot;label2&quot;, etc]
	nextprev: [&quot;Previous&quot;, &quot;Next&quot;],
	revealtype: &quot;click&quot;,
	enablefade: [true, 0.2],  //[true/false, fadedegree]
	autorotate: [true, 3000],  //[true/false, pausetime]
	onChange: function(previndex, curindex){  //event handler fired whenever script changes
		//previndex holds index of last slide viewed b4 current (1=1st slide, 2nd=2nd etc)
		//curindex holds index of currently shown slide (1=1st slide, 2nd=2nd etc)
	}
})
&lt;/script&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;div class=&quot;contentdiv&quot;&gt;
		&lt;div class=&quot;{@Style}&quot;&gt;
		&lt;img border=&quot;0&quot; align=&quot;left&quot; hspace=&quot;0&quot; vspace=&quot;0&quot; alt=&quot;{substring-after(@Image, ', ')}&quot; src=&quot;{substring-before(@Image, ', ')}&quot; /&gt;
	&lt;a href=&quot;{substring-before(@Link_x0020_URL, ', ')}&quot; title=&quot;{@Title}&quot;&gt;
	&lt;h1&gt;&lt;xsl:value-of select=&quot;@Title&quot; /&gt;&lt;/h1&gt;&lt;/a&gt;
	&lt;p&gt;&lt;xsl:value-of select=&quot;substring(@Body,1,330)&quot;/&gt;...&lt;/p&gt;
	&lt;a href=&quot;{substring-before(@Link_x0020_URL, ', ')}&quot; class=&quot;readMoreLink&quot; title=&quot;{substring-after(@Link_x0020_URL, ', ')}&quot;&gt;
	&lt;span class=&quot;readMoreIcon&quot;&gt;&lt;xsl:value-of select=&quot;substring-after(@Link_x0020_URL, ', ')&quot; /&gt;&lt;/span&gt;
	&lt;/a&gt;
	&lt;/div&gt;
	&lt;/div&gt;&lt;/xsl:template&gt;
&lt;/xsl:stylesheet&gt;
&lt;/Xsl&gt;
</pre>
<p>For information on how to write xsl stylesheets read <a href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx">this post</a> on Heather Solomon&#8217;s site. Basically using tags like this:<br />
allows you to insert various peices of data from the list. In the xsl above I am wrapping each item with the nessacary div to make the slider work. Inside each div I am inserting the title inside an h1 tag, the first 330 characters of the body in an a p tag, and the Link URL formatted as a Hyperlink.</p>
<p>To make everything look good I had to customize the CSS that comes from Dynamic Drive. The code is below.</p>
<pre class="brush: css;">
.sliderwrapper{
position: relative; /*leave as is*/
overflow: hidden; /*leave as is*/
border: 0px;
width: 100%; /*width of featured content slider*/
height: 231px;
}
.sliderwrapper .contentdiv{
visibility:hidden; /*leave as is*/
position:absolute; /*leave as is*/
left:0;  /*leave as is*/
top:0;  /*leave as is*/
padding: 0px;
background:#fff;
width:100%;
/*width of content DIVs within slider. Total width should equal slider's inner width (390+5+5=400) */
height:100%;
filter:progid:DXImageTransform.Microsoft.alpha(opacity=100);
-moz-opacity:1;
opacity:1;
color:#fff;
font-size:x-small;
}
.contentdiv img{
height:205px;
width:270px;
margin:10px;
border:1px solid #ccc;
}
.contentdiv h1{
color:#eee;
font:normal normal large Georgia;
margin:0px;
padding:5px 0 0 0;
line-height:20px
}
.contentdiv a:hover, .contentdiv a{
text-decoration:none !important;
padding:0px;
}
.contentdiv p{
line-height:19px;
padding:0px 10px 0px 10px;
}
a.readMoreLink {
color:#555;
padding:4px;
background-color:#fff;
}
a.readMoreLink:hover {
color:#555;
text-decoration:none;
padding:4px;
background:#fff url('link_bg.gif') repeat-x bottom center;
}
.pagination{
width: 100%;
/*Width of pagination DIV. Total width should equal slider's outer width (400+10+10=420)*/
text-align: right;
padding: 3px 1px;
font-size:x-small;
background:#fff url('link_bg.gif') repeat-x bottom center;
border-top:1px solid #ccc;
}
.pagination a{
padding: 0 4px;
text-decoration: none;
color: #666;
background:#fff;
}
.pagination a.selected{
color: #fff;
background-color: #666;
}
.pagination a:hover{
color:#fff;
background:#666;
text-decoration:none;
}
</pre>
<p>In the XSL stylesheet each item is wrapped in a div, the class name for the div is pulled from the &#8216;Style&#8217; column in the list. The make the styles work I added the following CSS to my stylesheet</p>
<pre class="brush: css;">
.Red_Style{
height:230px;
background:#671818 url('red_bg.gif') repeat-x top center;
}
.Blue_Style{
height:230px;
background:#3A5E97 url('blue_bg.gif') repeat-x top center;
}
.Green_Style{
height:230px;
background:#4E8822 url('green_bg.gif') repeat-x top center;
}
</pre>
<p>All I am doing is changing the background image and color for each style. Because the div wraps each item it would be possible to also change font colors, font size, image position and more but I just wanted to keep it simple.</p>
<p>The only drawback with using the dataview webpart is that this webpart cannot be easily moved from one site to another.</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/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>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
