SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    UK
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Conflict between separate pieces of DHTML on my Site?

    Hi Folks

    I have two separate pieces of DHTML on my Site.
    One is an Opencube Quick Menu and the other is cross-browser marquee script II from Dynamic Drive.
    Each works independently but since I've added the marquee script the Quick Menu no longer functions. Is there a conflict between and the two and how do I resolve it please?
    Cheers

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That sure sounds like a conflict, especially since you got one from Dynamic Drive (ugh).

    We would need to see the code.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    UK
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the Marquee script which in itself works okay although it is conflicting with the DHTML Quickmenu (which now doesn't work & did before).


    <table cellspacing=0 cellpadding=0 align=center border=0>
    <tbody>
    <tr valign=top align=left>
    <td width=8><img height=8 alt=""
    src="../graphics/newsboxtopleftcorner.gif" width=8></td>
    <td width=100 background="../graphics/newsboxtop.gif"><img
    height=8 alt="" src="../graphics/newsboxtop.gif" width=100%></td>
    <td width=8><img height=8 alt=""
    src="../graphics/newsboxtoprightcorner.gif" width=8></td>
    </tr>
    <tr valign=top align=left>
    <td background="../graphics/newsboxtopleft.gif"><img height=8
    alt="" src="../graphics/newsboxtopleft.gif" width=8></td>
    <td class="newsboxtitle">Latest RCA News</td>
    <td background="../graphics/newsboxtopright.gif"><img height=8
    alt="" src="../graphics/newsboxtopright.gif" width=8></td>
    </tr>
    <tr valign=top align=left>
    <td><img height=13 alt=""
    src="../graphics/newsboxdividerleft.gif" width=8></td>
    <td background="../graphics/newsboxdivider.gif"><img height=13
    alt="" src="../graphics/newsboxdivider.gif" width=8></td>
    <td><img height=13 alt=""
    src="../graphics/newsboxdividerright.gif" width=8></td>
    </tr>
    <tr valign=top align=left>
    <td background="../graphics/newsboxleft.gif"><img height=8
    alt="" src="../graphics/newsboxleft.gif" width=8></td>
    <td>
    <script language="JavaScript1.2">
    /* Cross browser marquee script II - Dynamic Drive (www.dynamicdrive.com) */
    var marqueewidth=132
    var marqueeheight=50
    var speed=1
    //Specify the marquee contents
    var marqueecontents='<a href="stmarysnews.htm" class="marquis">RCA News Item 1</a><br>'

    if (document.all)
    document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+marqueewidth+';height:'+marqueeheight+'">'+marqueecontents+'</marquee>')

    function regenerate() {
    window.location.reload()
    }

    function regenerate2(){
    if (document.layers){
    setTimeout("window.onresize=regenerate",450)
    intializemarquee()
    }
    }

    function intializemarquee(){
    document.cmarquee01.document.cmarquee02.document.write(marqueecontents)
    document.cmarquee01.document.cmarquee02.document.close()
    thelength=document.cmarquee01.document.cmarquee02.document.height
    scrollit()
    }

    function scrollit(){
    if (document.cmarquee01.document.cmarquee02.top>=thelength*(-1)){
    document.cmarquee01.document.cmarquee02.top-=speed
    setTimeout("scrollit()",100)
    }
    else{
    document.cmarquee01.document.cmarquee02.top=marqueeheight
    scrollit()
    }
    }

    window.onload=regenerate2
    </script>
    <ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
    <layer name="cmarquee02" width=&{marqueewidth}; height=&{marqueeheight};></layer>
    </ilayer>
    </td>
    <td background="../graphics/newsboxright.gif"><img height=8
    alt="" src="../graphics/newsboxright.gif" width=8></td>
    </tr>
    <tr valign=top align=left height=8>
    <td><img height=8 alt="" src="../graphics/newsboxbottomleft.gif"
    width=8></td>
    <td background="../graphics/newsboxbottom.gif"><img height=8
    alt="" src="../graphics/newsboxbottom.gif" width=8></td>
    <td><img height=8 alt=""
    src="../graphics/newsboxbottomright.gif"
    width=8></td>
    </tr>
    </tbody>
    </table>

  4. #4
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    UK
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Opencube Quick Menu uses a number of scripts which I'll try and attach as a Zip File. The actual page code (if this helps?) minus the marquee script is below.
    Many thanks

    (Page code removed after problem was solved by Maian)
    Last edited by Andre_Sam; Jun 2, 2005 at 14:15.

  5. #5
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    UK
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Zip attached of various Quick Menu scripts
    Last edited by Andre_Sam; Jun 2, 2005 at 14:12.

  6. #6
    SitePoint Guru
    Join Date
    Feb 2005
    Posts
    602
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Didn't look at the menu script, but try replacing

    Code:
     window.onload=regenerate2
    with:

    Code:
    (function() {
    	var oldWindowOnload = window.onload;
    	window.onload = function() {
    		if (oldWindowOnload)
    			oldWindowOnload();
    		regenerate2();
    	}
    })();
    The number one cause of conflicts is window.onload overriding.

  7. #7
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    UK
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Many, many thanks Main that did the trick!
    Cheers again much appreciated


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
  •