PDA

View Full Version : Cross Browser marquee - conflict CMotion Gallery



Dave25
01-20-2008, 04:21 AM
Cross Browser marquee

http://www.dynamicdrive.com/dynamicindex2/cmarquee.htm

Could somebody help me to get Cross Browser marquee to work with CMotion Gallery on the same page?
They both have <script language="JavaScript1.2.1"> and seem to conflict with each other. Any suggestions?
Thank you!

jscheuer1
01-20-2008, 05:00 AM
They both have <script language="JavaScript1.2.1">

No they don't.


and seem to conflict with each other.


I'll take your word for it.

The language attribute for script tags has been deprecated. In almost all cases, using the now required type attribute instead is the best course:


<script type="text/javascript">
script code
</script>

Or with external code:


<script src="some.js" type="text/javascript">
/* comments and/or credits, if any */
</script>

Getting back to your actual problem, the conflict is at least an onload conflict. There are several ways to resolve this. Here's one:

The marquee script has:


window.onload=populate

get rid of that. The Cmotion script has:


window.onload=fillup;

get rid of that too.

Now, in your body tag you can do (red, in addition to whatever else is already in your body tag):


<body onload="fillup();populate();">

There could also be other problems. If you need more help:

Please post a link to the page on your site that contains the problematic code so we can check it out.

dip
03-26-2008, 03:39 PM
search and find :)
thanks jscheuer1

<body onload="fillup();populate();"> fixed it