Originally Posted by
ianzzz5
Hi Ben,
Thank you very much, that's exactly what I'm looking for.
Would you know how I can change the font and font colour please, and also add a couple more lines to each Tip.
e.g.
Mr & Mrs D
A couple of lines of text
A couple of lines of text
ianzzz5, you need to follow this closely.
Create a (Xara) text box (not a line) with some placeholder text to the font size and type you want. This includes left, right, centre and full alignment.
This text will be replaced but the settings will remain.
In this text box's Placeholder HTML code (body), add the following:
Code:
<div id="textBox"> </div>
<script>
var tip=new Array()
tip[0]="<span style='color:red;'>Tip 1: Mr & Mrs D</span>"
tip[1]="This is Tip 2"
tip[2]="This is Tip 3"
tip[3]="This is Tip 4"
tip[4]="This is Tip 5"
tip[5]="This is Tip 6"
tip[6]="<span>Tip 7: A couple of lines of text<br />A couple of line of text</span>"
tip[7]="<span>Tip 8: Another line of text"
var randomTip=Math.floor(Math.random()*tip.length)
document.getElementById("textBox").innerHTML = tip[randomTip];
</script>
To change to a different colour you need to add HTML code as shown.
Tip 6 technically does not need the span Tags but if you are wanting to tweak things you need them to hang the tweaks around in some in-line CSS.
Acorn
Bookmarks