Results 1 to 4 of 4

Thread: Flashing Table Border HELP, PLEASE

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

    Default Flashing Table Border HELP, PLEASE

    I used the following code from the OTHER Link on the home page: (SEE BELOW)

    The issue I have is that I have 2 boxes on my Page that I tried to apply this to. I can get one to work but not both. IF set the intervals on both boxes to the same then neither work, IF I set the time intervals for each box Differently then it gives me a weird flash.

    I did start by changing the id="myexample" to a different name on each box but still can not get it to work,

    You can see it at: www.sultrynitesonline.com

    Any help would be appreciated!!
    Mattyman

    <table border="0" width="280" id="myexample" style="border:5px solid green">
    <tr>
    <td>Insert anything you want into this table.<br>Insert anything you want into this table.<br>Insert anything you want into this table.<br></td>
    </tr>
    </table>
    <script language="JavaScript1.2">
    <!--

    /*
    Flashing Table Border Script- © Dynamic Drive (www.dynamicdrive.com)
    Visit http://www.dynamicdrive.com for this script
    Credit must stay intact for use
    */

    //configure interval btw flash (1000=1 second)
    var speed=500

    function fla****(){
    var crosstable=document.getElementById? document.getElementById("myexample") : document.all? document.all.myexample : ""
    if (crosstable){
    if (crosstable.style.borderColor.indexOf("green")!=-1)
    crosstable.style.borderColor="red"
    else
    crosstable.style.borderColor="green"
    }
    }
    setInterval("fla****()", speed)
    //-->
    </script>

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

    Default

    it works, just changes every 1 MILIsecond

    Is that a new, elaborate spam or something, btw: not my kind of site to visit....
    Last edited by ItsMeOnly; 09-08-2006 at 07:30 PM.

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

    Default

    OK, If that is the case then how do I get it so they both flash the way the sales item flashes??

  4. #4
    Join Date
    Aug 2006
    Posts
    239
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    change the myexaple to something more ingeneous
    second: function fla****() can be written to take argument, and that argument can be element id ("myexample" here)
    Code:
    function fla***(object) {
    [...]
    var object;
    var crosstable=document.getElementById? document.getElementById(object) : document.all? document.all.object : ""
    [...]
    setInterval("fla****("+object+")", speed);
    }
    now just call the function twice with parameters (arguments) like names of your tables....

    fla****("mytable1");
    fla****("mytable2");

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
  •