Hello. Thanks for the reply. I tried what you suggested above but the html tags still display as plain text. I want to put a line break and then more text. Basically I am trying to rotate a quote with the authors name.
Ive only have a minimal knowledge of JavaScript so this is new to me as I am still learning. Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Scrolling text</title>
<style type="text/css">
body{margin:0;padding:0;}
#pge {width:500px;margin:10px auto;}
#scrollme{display:block;padding:13px;height:300px;background-color:#990000;color:#ffffff;}
fieldset {border:1px solid #000;}
h1{margin:30px;text-align:center;}
span {color:#330066;font-style:italic;}
</style>
</head>
<body>
<div id="pge"><fieldset><legend>InnerHTML tests</legend>
<div id="scrollme"><h1>Hamlet's Genuineness</h1></div>
</fieldset></div>
<script type="text/javascript">
function $(id){
if (document.getElementById) return document.getElementById(id);
if (document.all) return document.all[id];
}
var msgs=["<p><span>Queen : <br></span>And let thine eye look like a friend on Denmark.<br>Do not for ever with thy vailed lids<br>Seek for thy noble father in the dust.<br>Thou know’st ‘tis common : all that lives must die,<br>Passing through nature to eternity.</p>","<p><span>Hamlet :<br></span>Ay, madam, it is common.</p>","<p><span>Queen :<br></span> If it be,<br>Why seems it so particular with thee ?</p>","<p><span>Hamlet :<br></span> Seems, madam ? Nay, it is. I know not ‘seems’.<br>‘Tis not alone my inky cloak, good mother,<br>Nor customary suits of solemn black,<br>Nor windy suspiration of forc’d breath,<br>No, nor the fruitful river in the eye,<br>Nor the dejected haviour of the visage,<br>Together with all forms, moods, shapes of grief,<br>That can denote me truly. These indeed seem,<br>For they are actions that a man might play ;<br>But I have that within which passes show,<br>These but the trappings and the suits of woe.</p>"];
var msgi=0;
function scrollMessages(milliseconds) {
window.setInterval(displayMessage, milliseconds)
}
function displayMessage(){
$("scrollme").innerHTML=msgs[msgi++];
msgi%=msgs.length;
}
scrollMessages(2000);
</script>
</script>
</body>
</html>>
Your slider use probably jQuery with an other function $ ?
Change the name of the this function by replacing all $, in the proposed script, with getElm (or an other name).
Bookmarks