Entering text into Form to scroll contents

Many thanks again for your help.
If you can stand a couple of more questions; how can I add a 'start scrolling function, it seems that currently upon page load the scrolling begins. I’d prefer not constant scrolling…(or maybe a Pause button). Also, whatever text gets submitted appears smaller than the add text here" which is scrolling as an example, in the ‘vmarquee’, how to make the submitted text bigger? Thanks again

Currently scrolling begins 2 seconds after page load, set by delayb4scroll=2000.

To prevent scrolling starting until a button is pressed: delete (or comment out) the last 6 lines of the script within your <head> section (not including </script>).

Then you can add a start button, similar to the submit button, that calls initializemarquee(). Note there will still be a 2 second delay before scrolling starts unless delayb4scroll is set to zero.

Change your <h4> element to an ordinary <p> element then you can style the text in both the textarea and in the marquee like this example:

textarea,#vmarquee{
font: 20px cursive;
}

I see there are remnants of code to pause the scroller on mouseover.

I suggest you put “Hey ... say something!” as placeholder text.

I don’t understand what you are trying to achieve. Who is going to want to put text in the textarea and then see it scroll in a box above?

2 Likes

Much thanks again for the great help.
I’ve tried to add a stop marquee function and button, without success:

function stopmarquee (){
var marquee = document.getElementById ("marquee");
marquee.stop ();
}
<button onclick="stopmarquee()">Stop Scroll</button>

any additional guidance is welcomed.

Also, is marquee tag deprecated? If so, does that mean this won’t work in many browsers? If so, what is a good alternative?

Thanks again

To stop the scrolling, use clearInterval(lefttime)

The HTML <marquee> element is deprecated but you are not using it.

1 Like

Thanks again for all the help.
Is there any way to make the #marqueecontainer resizable by the user/viewer?

To the CSS for #marqueecontainer add:
resize:both;

Thank you again.
Do you know how that might work viewing the page via mobile device?

I cannot resize the marquee or the textarea on my smartphone (but the resize handles are shown at the bottom right corner of both).

Thanks again for you previous great help.
Everything works successfully, except pausing the scroll.
I have this:

var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

as you can see in here:

var delayb4scroll=0 //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)?

	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);
	}

	function stopmarquee (){
	var marquee = document.getElementById ("marquee");
	marquee.stop ();
	}

but it doesn’t pause on mouse over.

Here’s more code:

<div id="marqueecontainer">
<video id="jvideo" autoplay muted class="video-js vjs-default-skin" controls></video>
<div id="vmarquee">
TEXT
TEXT
TEXT
</div>
</div><!--marqueecontainer-->

If I can’t get pause on mouseover, maybe help with a pause button.
Any assistance is welcomed.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.