PDA

View Full Version : scrolling marquee



JimW
12-21-2012, 07:57 PM
1) Script Title: scrolling marquee

2) Script URL (on DD):

3) Describe problem: I have 2 scrolling marquees on the same page and they worked for a long time but now one has stopped working. What could be the cause?

traq
12-21-2012, 08:35 PM
they worked for a long time but now one has stopped working. What could be the cause?
You are in a far better position to answer this than any of us are. What has changed recently?


If you need help to figure it out,
Please post a link to the page on your site that contains the problematic script so we can check it out.

also,
Warning: Please include a link to the DD script in question in your post. See this thread (http://www.dynamicdrive.com/forums/showthread.php?t=6) for the proper posting format when asking a question.

djr33
12-21-2012, 08:41 PM
Just to add one thing to traq's post, there are two possible explanations:

1. Something changed on the page, causing an error/conflict. (Scripts don't spontaneously stop working.) Did you update it recently?

2. You recently updated your computer or are using a new browser/computer to view the website. Try reverting back to the old system (if you can) to see if that is the problem, or if that is difficult at least let us know what was updated-- maybe you're using Chrome instead of IE as your browser now.

(3. If you're using any external links to .js or other files, those might have been changed on the other websites-- check for this, and I'd recommend keeping local copies of everything on your server instead, unless you are certain that websites intend for you to link to them-- a few do, such as Google hosting jQuery.)

JimW
12-22-2012, 05:22 PM
1 no updates
2 no computer updates
3 .js code is for Amber Alert
4. go to source code and you will find both scrolling codes
5 http://www.thecentraldatabank.com/usa/alabama_cities/Abbeville/ForSale/ads/default.asp

Beverleyh
12-22-2012, 05:47 PM
In point 3 you mention 'amber alert' - can you please clarify what that is and why it is a key factor (ie - why you've specifically mentioned it - there doesn't appear to be an obvious connection to anything previously described and what might be immediately obvious to you on the inside, sadly isn't to the rest of us on the outside looking in)

Also please provide the links to the scripts here on the DD website. We appreciate that we can view your source code but we need to know which scripts you've used so we can compare the original demo to the ones that are on your page. Maybe they've been adapted and that is whats causing a conflict, or maybe something as simple as a semi-colon has been deleted, or an extra comma added - with your source code and the original demo pages side by side, we can more easily look for such discrepancies.

vwphillips
12-22-2012, 07:10 PM
Cross browser Marquee script- Dynamic Drive (www.dynamicdrive.com)
only allows 1 scroller on a page

try


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/
.marquee {
position:relative;visibility:hidden;left:120px;top:0px;width:600px;height:30px;border:solid red 1px;
}

.marquee DIV {
visibility:visible;
}


/*]]>*/
</style></head>

<body>
<div id="marquee" class="marquee" onmouseover="zxcMarquee('marquee',0);" onmouseout="zxcMarquee('marquee',-1);">
<div><nobr>To place your ad on this Marguee, click on the link below</nobr><a></a></div>
</div>

<div id="marquee2" class="marquee" onmouseover="zxcMarquee('marquee2',0);" onmouseout="zxcMarquee('marquee2',-1);" >
<div><img src="http://codeamber.com/smlogo.jpg" alt="image" /><a></a></div>
</div>



<script type="text/javascript">
/*<![CDATA[*/
// Simple Marquee (09-November-2012)
// by Vic Phillips - http://www.vicsjavascripts.org.uk/

function zxcMarquee(id,spd,mde,fill){
var o=zxcMarquee['zxc'+id],obj=document.getElementById(id),spd=typeof(spd)=='number'?spd:0;
if (obj&&!o){
var s=obj.getElementsByTagName('DIV')[0],clds=s.childNodes,lst=clds[clds.length-1],mde=mde=='top'?['top','offsetTop','offsetHeight','left']:['left','offsetLeft','offsetWidth','top'],sz,fill=fill===true,nu,c,z0=1;
if (lst.nodeType!=1){
lst=lst.previousSibling;
}
obj.style.overflow='hidden';
s.style.position='absolute';
if (mde[0]=='left'){
s.style.width='30000px';
}
sz=lst[mde[1]]+lst[mde[2]];
if (fill){
nu=Math.ceil(obj[mde[2]]/sz)+1;
c=s.cloneNode(true);
for (;z0<nu;z0++){
c=c.cloneNode(true);
c.style[mde[0]]=sz*z0+'px';
c.style[mde[3]]='0px';
s.appendChild(c);
}
}
o=zxcMarquee['zxc'+id]={
mde:mde[0],
s:s,
sz:sz,
lft:s[mde[1]],
w:obj[mde[2]],
fill:fill
}
}
if (o){
o.lft+=spd;
if ((spd>0&&o.lft>(o.fill?0:o.w))||(spd<0&&o.lft<-o.sz)){
o.lft+=(o.fill?o.sz:(o.w+o.sz))*(spd<0?1:-1);
}
o.s.style[o.mde]=o.lft+'px';
clearTimeout(o.to);
o.to=setTimeout(function(){ zxcMarquee(id,spd); },30);
}
}

// parameter 0 = the unique ID name of the paren DIV. (string)
// parameter 1 = (optional) the initial speed and direction. (number,default = 0 = pause)
// parameter 2 = (optional) the mode of exection, 'left' or 'top'. (string, default = 'left')
// parameter 3 = (optional) true = fill the scroller. (boolean, default = false = standard marquee)
zxcMarquee('marquee',-1);
zxcMarquee('marquee2',-1);

/*]]>*/
</script>

</body>

</html>