Results 1 to 4 of 4

Thread: Billboard Script - Objected expected error in a table.

  1. #1
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Billboard Script - Objected expected error in a table.

    Hello all first time poster here and very appreicative of the community you all have here.

    Any ways I have a question about this script called Billboard Script found here http://www.dynamicdrive.com/dynamici...lbillboard.htm.

    When I take the script and place it in a page by its self and put the div call as a stand alone element the script works fine in IE. But if I put the DIV call in a table cell it doesnt work any more and give a Object expected error.

    Here is the code that works well by its self:
    Code:
    <div id="contentwrapper">
    
    <div id="billboard0" class="billcontent">
    JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents.
    </div>
    
    <div id="billboard1" class="billcontent">
    Java is completely different from JavaScript- it's more powerful, more complex, and unfortunately, a lot harder to master.
    </div>
    
    <div id="billboard2" class="billcontent">
    Real life billboards use interesting transtional effects in between messages to catch viewers' attention. Well, so does this DHTML billboard script!
    </div>
    </div>
    If I put that same text in a table cell it causes the error.

    Code:
    <table width="100&#37;" >
    <tr><td>
    <div id="contentwrapper">
    
    <div id="billboard0" class="billcontent">
    JavaScript is a scripting language originally developed by Netscape to add interactivity and power to web documents.
    </div>
    
    <div id="billboard1" class="billcontent">
    Java is completely different from JavaScript- it's more powerful, more complex, and unfortunately, a lot harder to master.
    </div>
    
    <div id="billboard2" class="billcontent">
    Real life billboards use interesting transtional effects in between messages to catch viewers' attention. Well, so does this DHTML billboard script!
    </div>
    </div>
    </td>
    </tr>
    </table>
    This is not the only script that this happens with as well. I have tried other scroller scripts and found the same problem. Any ideas?

    Script Code:
    Code:
    <style type="text/css">
    
    /*Modify attributes of #contentwrapper below as desired*/
    #contentwrapper{
    width: 230px;
    height: 200px;
    border: 1px solid black;
    background-color: #C6FFC6;
    padding: 5px;
    }
    
    .billcontent{
    width: 100%;
    display:block;
    }
    
    </style>
    
    <script type="text/javascript">
    
    /***********************************************
    * DHTML Billboard script- &#169; Dynamic Drive (www.dynamicdrive.com)
    * This notice must stay intact for use
    * Visit http://www.dynamicdrive.com/ for full source code
    ***********************************************/
    
    //List of transitional effects to be randomly applied to billboard:
    var billboardeffects=["GradientWipe(GradientSize=1.0 Duration=0.7)", "Inset", "Iris", "Pixelate(MaxSquare=5 enabled=false)", "RadialWipe", "RandomBars", "Slide(slideStyle='push')", "Spiral", "Stretch", "Strips", "Wheel", "ZigZag"]
    
    //var billboardeffects=["Iris"] //Uncomment this line and input one of the effects above (ie: "Iris") for single effect.
    
    var tickspeed=2000 //ticker speed in miliseconds (2000=2 seconds)
    var effectduration=500 //Transitional effect duration in miliseconds
    var hidecontent_from_legacy=1 //Should content be hidden in legacy browsers- IE4/NS4 (0=no, 1=yes).
    
    var filterid=Math.floor(Math.random()*billboardeffects.length)
    
    document.write('<style type="text/css">\n')
    if (document.getElementById)
    document.write('.billcontent{display:none;\n'+'filter:progid:DXImageTransform.Microsoft.'+billboardeffects[filterid]+'}\n')
    else if (hidecontent_from_legacy)
    document.write('#contentwrapper{display:none;}')
    document.write('</style>\n')
    
    var selectedDiv=0
    var totalDivs=0
    
    function contractboard(){
    var inc=0
    while (document.getElementById("billboard"+inc)){
    document.getElementById("billboard"+inc).style.display="none"
    inc++
    }
    }
    
    function expandboard(){
    var selectedDivObj=document.getElementById("billboard"+selectedDiv)
    contractboard()
    if (selectedDivObj.filters){
    if (billboardeffects.length>1){
    filterid=Math.floor(Math.random()*billboardeffects.length)
    selectedDivObj.style.filter="progid:DXImageTransform.Microsoft."+billboardeffects[filterid]
    }
    selectedDivObj.filters[0].duration=effectduration/1000
    selectedDivObj.filters[0].Apply()
    }
    selectedDivObj.style.display="block"
    if (selectedDivObj.filters)
    selectedDivObj.filters[0].Play()
    selectedDiv=(selectedDiv<totalDivs-1)? selectedDiv+1 : 0
    setTimeout("expandboard()",tickspeed)
    }
    
    function startbill(){
    while (document.getElementById("billboard"+totalDivs)!=null)
    totalDivs++
    if (document.getElementById("billboard0").filters)
    tickspeed+=effectduration
    expandboard()
    }
    
    if (window.addEventListener)
    window.addEventListener("load", startbill, false)
    else if (window.attachEvent)
    window.attachEvent("onload", startbill)
    else if (document.getElementById)
    window.onload=startbill
    
    </script>
    Last edited by Raithier; 03-11-2007 at 09:26 PM. Reason: Added script code for reference sake.

  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

    Not here. What version of IE are you using?
    - John
    ________________________

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

  3. #3
    Join Date
    Mar 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    IE 6 Sp2

  4. #4
    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

    I've got one of those on an old machine, no problem in it either.
    - John
    ________________________

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

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
  •