Advanced Search

Results 1 to 6 of 6

Thread: Running Two Javascripts on the same page

  1. #1
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Running Two Javascripts on the same page

    I maintain a web page for our church. We currently have a javascript slideshow running on the page and I've been asked to add a scroller banner. I've got the code for both but when I add in the scroller banner javascipt code it doesn't work. Does anyone know how to fix this problem

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,708
    Thanks
    2
    Thanked 388 Times in 383 Posts

    Default

    please post a link to your page and the scripts you are using
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

  4. #4
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,708
    Thanks
    2
    Thanked 388 Times in 383 Posts

    Default

    You have three body tags, there should only be one
    and other HTML coding errors

    I can see the Slide Show code but not the banner

    please provide details of the banner
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  5. #5
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    The scroller I want to implement is from Javascriptkit. Here's the code:

    <span id="highlighter" style="position:absolute;left:0;top:0;font-size:18px;font-family:Verdana;background-color:yellow;clip:rect(0px 0px auto 0px)"></span>
    </div>

    <script type="text/javascript">

    /*
    Highligher Scroller script- By JavaScript Kit
    For this and over 400+ free scripts, visit http://www.javascriptkit.com/
    This notice must stay intact
    */

    var tickercontents=new Array()
    tickercontents[0]='Looking for free Java applets and resources? Visit <a href="http://freewarejava.com">Freewarejava.com</a>!'
    tickercontents[1]='Hop on over to <a href="http://www.codingforums.com">Coding Forums</a> to get help on web coding!'
    tickercontents[2]='This scroller\'s brought to you by <a href="http://www.javascriptkit.com">JavaScript Kit</a>'

    var tickdelay=3000 //delay btw messages
    var highlightspeed=10 //10 pixels at a time.

    ////Do not edit pass this line////////////////

    var currentmessage=0
    var clipwidth=0

    function changetickercontent(){
    crosstick.style.clip="rect(0px 0px auto 0px)"
    crosstick.innerHTML=tickercontents[currentmessage]
    highlightmsg()
    }

    function highlightmsg(){
    var msgwidth=crosstick.offsetWidth
    if (clipwidth<msgwidth){
    clipwidth+=highlightspeed
    crosstick.style.clip="rect(0px "+clipwidth+"px auto 0px)"
    beginclip=setTimeout("highlightmsg()",20)
    }
    else{
    clipwidth=0
    clearTimeout(beginclip)
    if (currentmessage==tickercontents.length-1) currentmessage=0
    else currentmessage++
    setTimeout("changetickercontent()",tickdelay)
    }
    }

    function start_ticking(){
    crosstick=document.getElementById? document.getElementById("highlighter") : document.all.highlighter
    crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement
    if (parseInt(crosstick.offsetHeight)>0)
    crosstickParent.style.height=crosstick.offsetHeight+'px'
    else
    setTimeout("crosstickParent.style.height=crosstick.offsetHeight+'px'",100) //delay for Mozilla's sake
    changetickercontent()
    }

    if (document.all || document.getElementById)
    window.onload=start_ticking

    </script>

    <p align="left">This free script provided by<br />
    <a href="http://javascriptkit.com">JavaScript Kit</a></p>

    Once I have it installed and working I want to change the background color, reduce the speed and lenght of time each item shows, all of which I can do.

  6. #6
    Join Date
    Mar 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I'm sorry, I also meant to post that I'll change the content of the scroller and that I want the scroller to appear just below the slideshow on the landing page..........

Similar Threads

  1. 2 javascripts in one page
    By vicram in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 03-08-2010, 06:13 AM
  2. Replies: 2
    Last Post: 08-14-2008, 02:17 AM
  3. javascripts on same page?
    By grb in forum JavaScript
    Replies: 2
    Last Post: 02-20-2007, 04:02 PM
  4. Multiple javascripts on same page
    By seanflakes in forum JavaScript
    Replies: 1
    Last Post: 11-10-2005, 05:34 AM
  5. Two Javascripts on one page
    By jaykantor in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 09-29-2004, 06:56 PM

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
  •