SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    problem between two scripts

    Hi !!

    I'm contacting mikefoster, because i've got a problem between two scripts!!

    i'm using this script for div: xFenster

    However since i'm using another following script to have an clock system the div do not appear anymore and even if i force to let appear one of the div it's not anymore dragable!

    if i juste delete this script problem is solved!
    so it should come from a confllict between those two script!!

    how can i solve this problem???
    thanks

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    function getthedate(){
    var mydate=new Date()
    var hours=mydate.getHours()
    var minutes=mydate.getMinutes()
    var seconds=mydate.getSeconds()
    var dn="Am"
    if (hours>=12)
    dn="Pm"
    if (hours>12){
    hours=hours-12
    }
    
    if (hours==0)
    hours=12
    if (minutes<=9)
    minutes="0"+minutes
    if (seconds<=9)
    seconds="0"+seconds
    var cdate="   "+hours+":"+minutes+":"+seconds+" "+dn+"  "
    if (document.all)
    document.all.iclock.innerHTML=cdate
    else if (document.getElementById)
    document.getElementById("iclock").innerHTML=cdate
    else
    document.write(cdate)
    }
    if (!document.all&&!document.getElementById)
    getthedate()
    function givehour(){
    if (document.all||document.getElementById)
    setInterval("getthedate()",1000)
    }
    window.onload=givehour
    </script>

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You have two assignments to the window.onload method. What does your other onload handler look like?

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the other onload function comes from your script:
    Code:
    <SCRIPT type=text/javascript>
    window.onload = function()
    {
        if (window.winOnLoad) window.winOnLoad();
    }
    and the other part that perhaps could help you
    [code]
    function winOnLoad()
    {
    for (var i = 1; i <= fen_count; ++i) {
    fen[i] = new xFenster('fen'+i, 180+i*80, 200+i*50, 'fenBar'+i, 'fenResBtn'+i, 'fenMaxBtn'+i);
    }
    }
    window.onunload = function()
    {
    for (var i = 1; i <= fen_count; ++i) {
    fen[i].onunload();
    }
    }
    </SCRIPT>
    [code]

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi,

    is there any conflict between onunload script?
    thanks

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2005
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    please can someone help me??


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
  •