View Full Version : Site with two marquees
basilthemouse
04-09-2007, 03:19 AM
hi
i have a vertically scrolling marquee on my blog and works well, however, wen i try to put a second one on my site, i get 'error on page' message and neither marquees will function. The marquee on my site now has a stop / start function so visitors can choose whether or not to activate it (thus not causing a 'tacky' appearance). Is this causing the problem ? Can anyone help to ensure that I can get both marquees functioning (both with stop / start activation buttons).
thnx
Basil
dave007
04-09-2007, 04:22 AM
Hi basil,
Could you give a link to the page so we can see the code
The error on page may be caused if they are both calling the same js functions or if they are repeating them
basilthemouse
04-09-2007, 05:22 AM
Dave
Thanks for the reply. Here is the coding for the one I jhave now. What changes can I make to the second one I wish to put on my blog. It seems I cant just copy and paste this script and use that as my second marquee with different content on a different part of my page. Perhaps I should mention that this marquee is located on a side section while the other will be placed on a another section of the page called 'profile section'
I'm not really very good at this and I am learning by trial and error about JS. Excuse my ignorance.
<center>
<a href="javascript:scroller.start()"><img src="http://i153.photobucket.com/albums/s228/jdrgibbons/start.png" border=0></a>
<img src="http://i153.photobucket.com/albums/s228/jdrgibbons/MYLINKS.png" border=0>
<a href="javascript:scroller.stop()"> <img src="http://i153.photobucket.com/albums/s228/jdrgibbons/stop.png" border=0></a>
<br>
<p align="center"><marquee id="scroller" direction=up width=200 height=130 style="background-color:lightyellow;border:1px solid purple" interval="50">
CONTENT HERE
</marquee>
<br>
Just in case u want to see the script:
<script>
<!--
function land(ref, target)
{
lowtarget=target.toLowerCase();
if (lowtarget=="_self") {window.location=loc;}
else {if (lowtarget=="_top") {top.location=loc;}
else {if (lowtarget=="_blank") {window.open(loc);}
else {if (lowtarget=="_parent") {parent.location=loc;}
else {parent.frames[target].location=loc;};
}}}
}
function jump(menu)
{
ref=menu.choice.options[menu.choice.selectedIndex].value;
splitc=ref.lastIndexOf("*");
target="";
if (splitc!=-1)
{loc=ref.substring(0,splitc);
target=ref.substring(splitc+1,1000);}
else {loc=ref; target="_self";};
if (ref != "") {land(loc,target);}
}
//-->
</script>
To get a clearer picture, it might be better to go to the site itself:
http://gibbons.blogdrive.com
Thanks again for the help.
basil
dave007
04-09-2007, 05:34 AM
Hi
Your getting the error on page because your repeating the elements in the page and the javascript is getting confused.
You can duplicate the scrollers you have, you just have to give them different id's.
<div style="float:left">
<a href="javascript:scroller.start()"><img src="http://i153.photobucket.com/albums/s228/jdrgibbons/start.png" border=0></a>
<img src="http://i153.photobucket.com/albums/s228/jdrgibbons/MYLINKS.png" border=0>
<a href="javascript:scroller.stop()"> <img src="http://i153.photobucket.com/albums/s228/jdrgibbons/stop.png" border=0></a>
<br>
<p><marquee id="scroller" direction=up width=200 height=130 style="background-color:lightyellow;border:1px solid purple" interval="50">
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
</marquee>
</div>
<div style="float:right">
<a href="javascript:scroller2.start()"><img src="http://i153.photobucket.com/albums/s228/jdrgibbons/start.png" border=0></a>
<img src="http://i153.photobucket.com/albums/s228/jdrgibbons/MYLINKS.png" border=0>
<a href="javascript:scroller2.stop()"> <img src="http://i153.photobucket.com/albums/s228/jdrgibbons/stop.png" border=0></a>
<br>
<p><marquee id="scroller2" direction=up width=200 height=130 style="background-color:lightyellow;border:1px solid purple" interval="50">
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
CONTENT HERE<br />
</marquee>
</div>
You have to change the id of the marquee tags and change the id of the element the javascript is trying to control to match.
basilthemouse
04-09-2007, 06:14 AM
Dave
That is much appreciated. I will give it a go. Seems very logical actually, now I think about it. :o
Will get back here to let you know how it has worked out and give you one more word of thanks.
best regards
basil
basilthemouse
04-09-2007, 06:19 AM
Dave
Works wonderfully. Thanks so much.
best
Basil
dave007
04-09-2007, 06:20 AM
Your welcome
basilthemouse
04-09-2007, 09:14 AM
Dave (or anyone)
Just a quick question. At the moment the scroll begins when the page loads. How can I ensure that the when the page loads the function of the scroll is 'stop; and will start only when 'started' by any visitor. What code or adjustments are necessary ?
Thanks again
Basil
dave007
04-09-2007, 12:20 PM
Hi,
<marquee onStart="javascript:this.stop()" id="scroller" direction=up width=200 height=130 style="background-color:lightyellow;border:1px solid purple" interval="50">
Add the onStart="javascript:this.stop()" to the marquee tags, this is the only way I can think of that doesnt require the scroller to actually be written in javascript. This method only works in Internet Explorer but most general users still use that sadly and Im told <marquee> is a depreciated tag anyway.
Adding that code will stop the marquee when it starts requiring the user to click start
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.