PDA

View Full Version : DD Scrollable Content and validation



cristina86
05-04-2013, 11:50 AM
1) Script Title: DD Scrollable Content

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex11/scrollc2.htm#

3) Describe problem: I am trying to validate a XHTML page that uses the Scrollable Content. Long story, but I *can't* make it anything else than XHTML and I *can't* remove the Scrollable Content from it. The w3c validator has issues with the & and < of the script, but if I change them to &amp; and &lt; the script won't work anymore. Please help me, I'm desperate!!!

vwphillips
05-04-2013, 12:11 PM
<script type="text/javascript">
/*<![CDATA[*/

/******************************************
* Scrollable content script II- Dynamic Drive (www.dynamicdrive.com)
* Visit http://www.dynamicdrive.com/ for full source code
* This notice must stay intact for use
******************************************/

// modified 17-October-2011


function move(id,spd){
var obj=document.getElementById(id),max=-obj.offsetHeight+obj.parentNode.offsetHeight,top=parseInt(obj.style.top);
if ((spd>0&&top<=0)||(spd<0&&top>=max)){
obj.style.top=top+spd+"px";
move.to=setTimeout(function(){ move(id,spd); },20);
}
else {
obj.style.top=(spd>0?0:max)+"px";
}
}


/*]]>*/
</script>

cristina86
05-04-2013, 12:35 PM
Works perfectly! :) Thanks a ton!