Log in

View Full Version : Continous marquee



bitedevil
09-12-2006, 01:17 AM
Hi guys again, sorry i guess my last thread was a little confusing...
do any of you know if there is a way to make a marquee continous, basically instead of when the string ends having to have a huge gap and then the string showing again, i would like the string to just keep going. When the last character of the string ends i would like the string to start again instantly, without any white spaces inbetween, is this possible in HTML?

jscheuer1
09-12-2006, 02:04 AM
No. But, it can be done with javascript:

http://home.comcast.net/~jscheuer1/side/marqueeh.htm

or for a vertical version:

http://home.comcast.net/~jscheuer1/side/marquee.htm

These both are more cross browser friendly than the marquee tag which has only very limited support in browsers other than IE. A marquee tag (or really a better choice - static content) can be written inside a <noscript></noscript> tag to provide alternate content for javascript impaired browsers.

bitedevil
09-12-2006, 03:50 AM
ok, thanks a lot i will try javascript. My only concern is that, well i can use vbasic, qbasic, C++, and im kinda starting HTML now and Java, im not really familiar with any of them, and especially not java script, i've never used it in a html based website before.. could you maybe point me to a good java script tutorial plz? anyways thanks for your reply.

jscheuer1
09-12-2006, 05:38 AM
If you look at the source code, you will see that the configuration of these scripts is well documented as is the demarcation line where you should not cross in editing them. Even though they look long and involved, you just put them wherever you want them in your code, like they were a paragraph (<p></p>).

There are many online javascript tutorials. Javascript is all one word by the way. Here is a fairly good tutorial:

http://www.w3schools.com/js/default.asp

But, I wish they would get rid of that coffee cup image. Javascript is quite different from the Java programming language for which the coffee cup is an early logo, although the code is a little similar.

Alumnus
10-23-2008, 03:56 AM
Hello! :)

Is it possible to make this script to make a marquee continous? Any help will be very appreciate. Thank you very much!


<style type="text/css">

#marqueecontainer{
position: relative;
width: 167px; /*marquee width */
height: 276px; /*marquee height */
background-color: white;
overflow: hidden;
border: 1px solid black;
padding: 2px;
padding-left: 4px;
}

</style>

<script type="text/javascript">

/***********************************************
* Cross browser Marquee II- c Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=2000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''

function scrollmarquee(){
if (parseInt(cross_marquee.style.top)>(actualheight*(-1)+8)) //if scroller hasn't reached the end of its height
cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px" //move scroller upwards
else //else, reset to original position
cross_marquee.style.top=parseInt(marqueeheight)+8+"px"
}

function initializemarquee(){
cross_marquee=document.getElementById("vmarquee")
cross_marquee.style.top=0
marqueeheight=document.getElementById("marqueecontainer").offsetHeight
actualheight=cross_marquee.offsetHeight //height of marquee content (much of which is hidden from view)
if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
cross_marquee.style.height=marqueeheight+"px"
cross_marquee.style.overflow="scroll"
return
}
setTimeout('lefttime=setInterval("scrollmarquee()",30)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee


</script>


<div id="marqueecontainer" onmouseover="copyspeed=pausespeed" onmouseout="copyspeed=marqueespeed">
<div id="vmarquee" style="position: absolute; width: 96%; top: 0pt;">

<!--YOUR SCROLL CONTENT HERE-->

<h4> My text is here </h4>
<!--YOUR SCROLL CONTENT HERE-->

</div>
</div>

bluewalrus
10-23-2008, 07:18 AM
that code is continuous in all browsers (safari firefox) i tested it on do you have a link to the page you have it on?

ALSO I've found php to be similar to qbasic might want to look at that.

Alumnus
10-23-2008, 08:08 AM
that code is continuous in all browsers (safari firefox) i tested it on do you have a link to the page you have it on?

ALSO I've found php to be similar to qbasic might want to look at that.


Bluewalrus,
Thank you very much for your reply.
I use FireFox, and i have checked it is IE too, but it does not seems continuous...


Thank you very much again.

jscheuer1
10-23-2008, 10:39 AM
Use:

http://home.comcast.net/~jscheuer1/side/marquee.htm

Alumnus
10-23-2008, 12:16 PM
Use:

http://home.comcast.net/~jscheuer1/side/marquee.htm


John, thank you very much for your reply.
I have already tried this script, but it works even worse for me. When i put my text, where the text has to be, it does not appear, or if it does appear, it starts from the middle of the marquee, or the font of the text is different or something else, always something does not work.:(

NXArmada
10-23-2008, 03:03 PM
can you give us a link to the page where you have ur code so we can see it.

Alumnus
10-23-2008, 03:15 PM
can you give us a link to the page where you have ur code so we can see it.

Thank you for your reply!
The link is here




The other problem is that in Firefox the font of the text looks like i want it to look, but in IE it looks differently, the letters are very big and I can not find the error or what makes it to look differently.
Thank you for your time.

jscheuer1
10-23-2008, 03:29 PM
John, thank you very much for your reply.
I have already tried this script, but it works even worse for me. When i put my text, where the text has to be, it does not appear, or if it does appear, it starts from the middle of the marquee, or the font of the text is different or something else, always something does not work.:(

Those are layout/implementation problems. The script you are currently using is not continuous. This one:

http://home.comcast.net/~jscheuer1/side/marquee.htm

is. If you are having problems using it, those can be worked out, but not if won't use it.

Alumnus
10-27-2008, 08:13 AM
Thank you very much!