PDA

View Full Version : a script doesn't work after modification



pusse
07-12-2005, 01:34 PM
Hi everybody. I'm a french student and I want yet excuse me for my english. He's so bad but i'll try to explain my problem. I found a script on this website (he's call Scrollable Content II). And whwn I try to modify it I have a strange problem. He don't write the last line of the list but he cut her in the middle ( like with the attribute line-throught im css). I have this problem just with IE and not with Firefox. Can you help me please it's very important.I give you the code :

<script type="text/javascript">

/******************************************
* 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
******************************************/

iens6=document.all||document.getElementById
ns4=document.layers

//specify speed of scroll (greater=faster)
var speed=5

if (iens6)
{
document.write('<div id="container" style="position:relative;height:92px;border-top:1px solid black; border-bottom:1px solid black;overflow:hidden">')
document.write('<div id="content" style="position:absolute;left:0;top:0">')
}
</script>

<ilayer name="nscontainer" height="92" clip="0,0,0,92">
<layer name="nscontent" height="92" visibility=hidden>

<!--INSERT CONTENT HERE-->
<p>DHTML is the combination of HTML, JavaScript, and CSS<br>
DOM stands for Document Object Model<br>
DHTML allows content on a page to change on the fly, without reloading the page<br>
CSS allows for the separation between content definition and formatting<br>
CSS stands for Cascading style sheet<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a> provides free, cut and paste DHTML scripts<br>
DHTML is the combination of HTML, JavaScript, and CSS<br>
DOM stands for Document Object Model<br>
DHTML allows content on a page to change on the fly, without reloading the page<br>
CSS allows for the separation between content definition and formatting<br>
CSS stands for Cascading style sheet<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a> provides free, cut and paste DHTML scripts</p>
<!--END CONTENT-->

</layer>
</ilayer>

<script language="JavaScript1.2"> if (iens6) document.write('</div></div>') </script>

<table>
<td>
<p align="right">
<a href="#" onMouseover="moveup()" onMouseout="clearTimeout(moveupvar)">
<img src="pictures/footer_leftArrow.jpg" border=0>
</a>
<a href="#" onMouseover="movedown()" onMouseout="clearTimeout(movedownvar)">
<img src="pictures/footer_leftArrow.jpg" border=0>
</a>
</p>
</td>
</table>

<script language="JavaScript1.2">
if (iens6)
{
var crossobj=document.getElementById? document.getElementById("content") : document.all.content
var contentheight=crossobj.offsetHeight
}
else if (ns4)
{
var crossobj=document.nscontainer.document.nscontent
var contentheight=crossobj.clip.height
}

function movedown()
{
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100)) crossobj.style.top=parseInt(crossobj.style.top)-speed+"px"
else if (ns4&&crossobj.top>=(contentheight*(-1)+100)) crossobj.top-=speed
movedownvar=setTimeout("movedown()",20)
}

function moveup()
{
if (iens6&&parseInt(crossobj.style.top)<=0) crossobj.style.top=parseInt(crossobj.style.top)+speed+"px"
else if (ns4&&crossobj.top<=0) crossobj.top+=speed
moveupvar=setTimeout("moveup()",20)
}

function getcontent_height()
{
if (iens6) contentheight=crossobj.offsetHeight
else if (ns4) document.nscontainer.document.nscontent.visibility="show"
}

window.onload=getcontent_height
</script>

Thanks a lot.

jscheuer1
07-13-2005, 05:58 AM
Your English, it is better than my French. We don't use male/female gender in our pronouns so much, usually just with people and animals. Anyways, to create a custom solution to your example, just add an empty span at the end of the content:


. . . CSS allows for the separation between content definition and formatting<br>
CSS stands for Cascading style sheet<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a> provides free,
cut and paste DHTML scripts</p><span></span>
<!--END CONTENT-->

pusse
07-13-2005, 07:15 AM
I have find a solution. I'll try to give it to you

in the script, with IE 6, I do a DIV with height=92px , and in the mouvedown, I do my test with 100px.That's why the scroll stop before the end. Thanks for evrybody for have take the time to try help me.

IanMarlowe
07-13-2005, 07:18 AM
alors, je parles francais. si tu veux que je te traduisse quelquechose pour les gens ici, je peux t'aider.