Hi,

I have an IFRAME. As the page within the frame is bigger than the frame it has a scroll bar. It scrolls from top to bottom. Is it possible to make it scroll from bottom to top?

I have tried doing this by using an anchor, but this didnt work.

Thanks,

    Can you not just change the page inside the frame, so the info you want first is at the top?

      No, I am afraid that would not work with the project im working on.

        Change the size of the frame?

          Again this can not be done. I can not change the situation. I no it is possible, I am just not sure how...

            When you say 'scroll from bottom to top' do you mean when the user click the little up/down arrow?

            Regards,
            -Chris

              So that the vertical scroll bar on the right of the IFRAME defaults from the bottom not the top.

                I know how to make it move auto from botton to top using "javascript", other than that, no ideas.

                  <script type="text/javascript">

                  // the page you want to appear in the iframe
                  var iframesrc="external.htm"

                  // other crap, width-height e.t.c
                  document.write('<iframe id="datamain" src="'+iframesrc+'" width="150px" height="150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"></iframe>')

                  </script>

                  Regards,
                  -Chris

                    Sorry I forgot to add, on the page you want to include add:

                    <script type="text/javascript">

                    // speed- 1 slower 5 faster
                    var scrollspeed=cache=2

                    // how long delay before it starts mseconds
                    var initialdelay=500

                    function initializeScroller(){
                    dataobj=document.all? document.all.datacontainer : document.getElementById("datacontainer")
                    dataobj.style.top="5px"
                    setTimeout("getdataheight()", initialdelay)
                    }

                    function getdataheight(){
                    thelength=dataobj.offsetHeight
                    if (thelength==0)
                    setTimeout("getdataheight()",10)
                    else
                    scrollDiv()
                    }

                    function scrollDiv(){
                    dataobj.style.top=parseInt(dataobj.style.top)-scrollspeed+"px"
                    if (parseInt(dataobj.style.top)<thelength*(-1))
                    dataobj.style.top="5px"
                    setTimeout("scrollDiv()",40)
                    }

                    if (window.addEventListener)
                    window.addEventListener("load", initializeScroller, false)
                    else if (window.attachEvent)
                    window.attachEvent("onload", initializeScroller)
                    else
                    window.onload=initializeScroller

                    </script>

                    Also, if you want it to stop when someone puts their mouse over it:

                    <div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%" onMouseover="scrollspeed=0" onMouseout="scrollspeed=cache">
                    </div>

                      No I couldnt get any think from here that helps. Can any one else help?

                      Thanks,

                        Well, first of all this has nothing to do with PHP; you'd probably have got faster and more expert help elsewhere, and you'd be finished by now. Think about that next time before you post inappropriately.

                        You don't need Javascript. Stick a #bottom fragment on the end of the URL, and have <a name="bottom"></a> at the bottom of the page, where you want it to scroll to when it displays.

                          Write a Reply...