Advanced Search

Results 1 to 2 of 2

Thread: My Code Doesnt Work With MooTools !

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

    Default My Code Doesnt Work With MooTools !

    Hi,
    When i add mootools.js between my codes, this timer code doesnt work correctly. help me please !

    HTML Code:
    <span id='1'>02:00:58</span>
    
    
    <script type='text/javascript'>
    var id=new Array(50);
    timer('1', 'index.php?tag=js');
    </script>
    
    
    function timer(data, lnk)
    {
        dat=document.getElementById(data);
        var time=(dat.innerHTML).split(":"); var done=0;
        if (time[2]>0) time[2]--;
        else
        {
            time[2]=59;
            if (time[1]>0) time[1]--;
            else
            {
                time[1]=59;
                if (time[0]>0) time[0]--;
                else { clearTimeout(id[data]); window.location.href=lnk; done=1;}
            }
        }
        if (!done)
        {
            dat.innerHTML=time[0]+":"+time[1]+":"+time[2];
            id[data]=setTimeout("timer('"+data+"', '"+lnk+"')", 1000);
        }
    }

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    1,880
    Thanks
    16
    Thanked 288 Times in 287 Posts
    Blog Entries
    4

    Default

    Where do you mean exactly when you say "between my codes"?

    Is the code you've posted everything, or have you combined a few code fragments and stripped out the rest? I ask because the opening and closing script tags are missing from around your JavaScript function.

    Another observation - its possible that the script isn't working because you've used a number in the id - an id should start with a letter (a-z).

    That's all I've got at the moment but if you post a link to your page, hopefully somebody will be able to offer further suggestions.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

Similar Threads

  1. Mootools slide galley does not work in my site
    By vitof123 in forum JavaScript
    Replies: 2
    Last Post: 08-11-2012, 08:45 AM
  2. Replies: 0
    Last Post: 06-13-2009, 08:59 PM
  3. Resolved js doesnt work in firefox but does in IE?
    By thedash in forum JavaScript
    Replies: 2
    Last Post: 05-20-2009, 04:27 PM
  4. Doesnt work in IE 5.0
    By rich1234 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 04-15-2008, 09:28 PM
  5. CSS in IE Six/Sux doesnt work right. HELP
    By SayJumner in forum CSS
    Replies: 7
    Last Post: 09-27-2007, 04:07 AM

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
  •