Results 1 to 3 of 3

Thread: <IFRAME> ticker has me confounded why it's not working

  1. #1
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default <IFRAME> ticker has me confounded why it's not working

    1) Script Title:
    <IFRAME> ticker
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...ame-ticker.htm
    3) Describe problem:
    I put this script on my webpage and after a lot of tinkering I still cannot get it to display more than the first message! Help! My page is http://www.mindpractice.com

    Thanks

  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

    Start over and don't tinker too much with it. Actually, I cannot tell if this is exactly your fault (sometimes an editor will do this all by itself) or not but, the script code has been converted to a single line on your:

    http://www.mindpractice.com/exfile.htm

    page. It is supposed to look like this:

    Code:
    <script language="JavaScript1.2">
    
    //IFRAME TICKER- By Dynamic Drive (http://www.dynamicdrive.com)
    
    //configure delay between changing messages (3000=3 seconds)
    var delay=3000
    
    var ie4=document.all
    
    var curindex=0
    var totalcontent=0
    
    function get_total(){
    if (ie4){
    while (eval("document.all.content"+totalcontent))
    totalcontent++
    }
    else{
    while (document.getElementById("content"+totalcontent))
    totalcontent++
    }
    }
    
    function contract_all(){
    for (y=0;y<totalcontent;y++){
    if (ie4)
    eval("document.all.content"+y).style.display="none"
    else
    document.getElementById("content"+y).style.display="none"
    }
    }
    
    function expand_one(which){
    contract_all()
    if (ie4)
    eval("document.all.content"+which).style.display=""
    else
    document.getElementById("content"+which).style.display=""
    }
    
    function rotate_content(){
    get_total()
    contract_all()
    expand_one(curindex)
    curindex=(curindex<totalcontent-1)? curindex+1: 0
    setTimeout("rotate_content()",delay)
    }
    
    window.onload=rotate_content
    
    </script>
    Not this:

    Code:
    <script language="JavaScript1.2">//IFRAME TICKER- By Dynamic Drive (http://www.dynamicdrive.com)//configure delay between changing messages (3000=3 seconds)var delay=6000var ie4=document.allvar curindex=0var totalcontent=0function get_total(){if (ie4){while (eval("document.all.content"+totalcontent))totalcontent++}else{while (document.getElementById("content"+totalcontent))totalcontent++}}function contract_all(){for (y=0;y<totalcontent;y++){if (ie4)eval("document.all.content"+y).style.display="none"elsedocument.getElementById("content"+y).style.display="none"}}function expand_one(which){contract_all()if (ie4)eval("document.all.content"+which).style.display=""elsedocument.getElementById("content"+which).style.display=""}function rotate_content(){get_total()contract_all()expand_one(curindex)curindex=(curindex<totalcontent-1)? curindex+1: 0setTimeout("rotate_content()",delay)}window.onload=rotate_content</script>
    If it is your editor that is at fault, try notepad or another text only editor for this job.
    - John
    ________________________

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

  3. #3
    Join Date
    Aug 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks. It did the trick. And yet more thanks for the quick reply!!

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
  •