Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Please help with script

    I am using a scroller script, which uses an external.htm file and the script is not showing on my site. Would anyone be able to tell why it isn't from the code? Thanks in advance...


    <script type="text/javascript">

    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //specify path to your external page:
    var iframesrc="http://www.newhopebaptistdalton.com/external.htm"

    //You may change most attributes of iframe tag below, such as width and height:
    document.write('<iframe id="datamain" src="'+iframesrc+'" width="200px" height="175px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')

    </script>


    <html>
    <body>

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

    <!-- ADD YOUR SCROLLER CONTENT INSIDE HERE -->

    <b>What's Hot</b></p>
    <p align="left"><strong><font face="Arial"><small><a href="http://www.dynamicdrive.com/dynamicindex9/encrypter.htm" target="_top">Source
    code encrypter</a>&nbsp;</small></font></strong><br>
    <font face="Arial" size="2">Scramble the source of any chunk of code using
    this unique script.</font></p>
    <p align="left"><strong><font face="Arial"><small><a href="http://www.dynamicdrive.com/dynamicindex5/flashlink.htm" target="_top">Flashing
    links</a>&nbsp;</small></font></strong><br>
    <font face="Arial"><small>Bring attention to special links, by making them
    flash!</small></font></p>
    <p align="left"><small><strong><font face="Arial"><a href="http://www.dynamicdrive.com/dynamicindex13/roamcursor.htm" target="_top">Roaming
    Cursor</a>&nbsp;</font></strong></small><br>
    <small><font face="Arial">Display a second, &quot;roaming&quot; cursor on your
    page with this fun animation script.</font></small></p>
    <p align="left"><font face="Arial"><strong><a href="http://www.dynamicdrive.com/dynamicindex11/animatedtitle.htm" target="_top"><small>Animated
    Document title</small></a><br>
    </strong><small>Animate into view your document's title!</small></font>

    <!-- END SCROLLER CONTENT -->

    </div>

    <script type="text/javascript">

    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    //Specify speed of scroll. Larger=faster (ie: 5)
    var scrollspeed=cache=2

    //Specify intial delay before scroller starts scrolling (in miliseconds):
    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>

    </body>
    </html>

  • #2
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    Code you posted above is the content of external.htm, yes?

    Have you put this in the page where you want the scroller to appear?
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * IFRAME Scroller script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //specify path to your external page:
    var iframesrc="external.htm"
    
    //You may change most attributes of iframe tag below, such as width and height:
    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>
    If its there, please post a link to the page where it is not appearing.

  • #3
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Thank you for the reply.....yes, I have the script placed on the page where I want it to appear... I've uploaded the external.htm to my root folder and changed the link to reflect it on the page...I'm thinking maybe that's the problem? I'm not sure how to fix it though.... Actually someone else is working on our site and asked me about this. Thanks again... the site is here:

    http://www.newhopebaptistdalton.com/nhbc.html

  • #4
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    Code:
    <div id="datacontainer" style="position:absolute;left:675px;top:110px;
    Try changing position values of that div, for example [like it is in original external.htm]:
    Code:
    left:1px;top;10px;

  • Users who have thanked freedom_razor for this post:

    me4u2nv (01-22-2009)

  • #5
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Hey, I changed the values you suggested and now it's showing, but it's showing in the upper left corner...what we're wanting is to get it to scroll on top of the "Newest Announcements" on the right side and change the font color to white...I don't think the script works when those values are changed....confused

  • #6
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    external.htm is the file that's being displayed on your page, in the IFRAME, if you want to change font color to white, do it in that file.
    And where exactly it will display is controlled by the position of the IFRAME, so adjust it in the code of your main page - nhbc.html, adding for example style declaration for 'datamain' [the IFRAME id]
    Code:
    <style type="text/css">
    <!--
    body,td,th {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 12px;
    }
    #datamain {position:absolute; left:675px; top:110px;}
    -->
    </style>
    Last edited by freedom_razor; 01-22-2009 at 11:11 PM.

  • Users who have thanked freedom_razor for this post:

    me4u2nv (01-23-2009)

  • #7
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Okay Freedom, we're going to try this shortly. Thank you for your help!

  • #8
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    Just about that white font, in case you're wondering where to do it.
    In external.htm
    Code:
    <div id="datacontainer" style="position:absolute;left:1px;top:10px;width:100%;color:#fff;"
    Mind you, that doesn't change default links' color, but I suppose you can work on it now.

  • Users who have thanked freedom_razor for this post:

    me4u2nv (01-23-2009)

  • #9
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    This worked great, but it's scrolling behind the image... any idea how to get it to scroll on top of the image? Thanks

  • #10
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    You can either move whole section:
    Code:
    <script type="text/javascript">
    
    /***********************************************
    * IFRAME Scroller script-  Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //specify path to your external page:
    var iframesrc="external.htm"
    
    //You may change most attributes of iframe tag below, such as width and height:
    document.write('<iframe id="datamain" src="'+iframesrc+'" width="200px" height="175px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="no"></iframe>')
    
    </script>
    to the end of the document [just before </BODY>] or preferably use z-index style property to move IFRAME above all else:
    Code:
    <style type="text/css">
    <!--
    body,td,th {
    	font-family: Arial, Helvetica, sans-serif;
    	font-size: 12px;
    }
    
    #datamain {position:absolute; left:675px; top:110px; z-index:10;}
    -->
    
    </style>
    Last edited by freedom_razor; 01-23-2009 at 02:14 AM.

  • Users who have thanked freedom_razor for this post:

    me4u2nv (01-23-2009)

  • #11
    New Coder
    Join Date
    Jan 2009
    Location
    Georgia
    Posts
    18
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Worked like a charm my friend, just need to align it up now.... you are MOST appreciated!!


  •  

    Posting Permissions

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