Results 1 to 4 of 4

Thread: a script doesn't work after modification

  1. #1
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question a script find on this site doesn't work after my modification

    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.
    Last edited by pusse; 07-12-2005 at 01:56 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    . . . 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-->
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    alors, je parles francais. si tu veux que je te traduisse quelquechose pour les gens ici, je peux t'aider.
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •