|
Joined: Jul 2004
Posts: 87
journeyman
|
journeyman
Joined: Jul 2004
Posts: 87 |
Last question today ;-) Is it possible to add some java script so _ can customise some scrolling messages on the board? script below:<script language="JavaScript1.2">
<!--
/*
Typing Scroller
Submitted by bengaliboy00@hotmail.com (hp: http://www.angelfire.com/nt/bengaliboy/)
With modifications by Dynamicdrive.com
For full source code, usage terms, and 100s more scripts, visit http://dynamicdrive.com
*/
//Secify scroller contents
var line=new Array()
line[1]="This is an awsome script"
line[2]="It brings up the text you want..."
line[3]="One letter at a time"
line[4]="You can add and subtract lines as you like."
line[5]="It\'s very cool and easy to use"
//Specify font size for scoller
var ts_fontsize="16px"
//--Don't edit below this line
var longestmessage=1
for (i=2;i<line.length;i++){
if (line[i].length>line[longestmessage].length)
longestmessage=i
}
//Auto set scroller width
var tscroller_width=line[longestmessage].length
lines=line.length-1 //--Number of lines
//if IE 4+ or NS6
if (document.all||document.getElementById){
document.write('<form name="bannerform">')
document.write('<input type="text" name="banner" size="'+tscroller_width+'"')
document.write(' style="background-color: '+document.bgColor+'; color: '+document.body.text+'; font-family: verdana; font-size: '+ts_fontsize+'; font-weight:bold; border: medium none" onfocus="blur()">')
document.write('</form>')
}
temp=""
nextchar=-1;
nextline=1;
cursor="\\"
function animate(){
if (temp==line[nextline] & temp.length==line[nextline].length & nextline!=lines){
nextline++;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else if (nextline==lines & temp==line[nextline] & temp.length==line[nextline].length){
nextline=1;
nextchar=-1;
document.bannerform.banner.value=temp;
temp="";
setTimeout("nextstep()",1000)}
else{
nextstep()}}
function nextstep(){
if (cursor=="\\"){
cursor="|"}
else if (cursor=="|"){
cursor="/"}
else if (cursor=="/"){
cursor="-"}
else if (cursor=="-"){
cursor="\\"}
nextchar++;
temp+=line[nextline].charAt(nextchar);
document.bannerform.banner.value=temp+cursor
setTimeout("animate()",25)}
//if IE 4+ or NS6
if (document.all||document.getElementById)
window.onload=animate
// -->
</script>
Last edited by Gizmo; 12/04/2007 5:07 PM. Reason: Added [code] tags.
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
Joined: Aug 2006
Posts: 1,358 |
Yes Combine it with something that retrieves the news items somewhere frmo the forum, and you got a cool thing
|
|
|
|
Joined: Jul 2004
Posts: 87
journeyman
|
journeyman
Joined: Jul 2004
Posts: 87 |
So I could just cut and paste the java above into the footer for example - won't make the board explode!?? <smile>
|
|
|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
Yes - you can run scripts on any part of your forum - this is after all what many adverts such as Google Adsense is.
|
|
|
|
Joined: Jul 2004
Posts: 87
journeyman
|
journeyman
Joined: Jul 2004
Posts: 87 |
|
|
|
|
Joined: Jul 2004
Posts: 87
journeyman
|
journeyman
Joined: Jul 2004
Posts: 87 |
oh - last q?
Can I have image AND scroller as part of header?
|
|
|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
You can have whatever you like in the header. I have images, java and a ticker in some forums. You should have no issues
|
|
|
|
Joined: Jul 2004
Posts: 87
journeyman
|
journeyman
Joined: Jul 2004
Posts: 87 |
|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
veteran
Joined: Dec 2006
Posts: 1,235 |
Even easier, use <marquee> tags. <marquee>
Type whatever you want here and it will scroll.
</marquee>
|
|
|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
I thought marquee only worked in IE?
|
|
|
|
Joined: Dec 2006
Posts: 1,235
veteran
|
veteran
Joined: Dec 2006
Posts: 1,235 |
Same here but I thought I'd try it with Firefox before I posted and it worked.
Don't know about other browsers though but unless you're running an Apple forum, 98% of your visitors will be able to see it. If it works with Opera then it's visibility should shoot up to about 98.1% :lol:
|
|
|
|
Joined: Jun 2006
Posts: 3,837
Carpal Tunnel
|
Carpal Tunnel
Joined: Jun 2006
Posts: 3,837 |
I guess more browsers recognise it these days.
|
|
|
|
Joined: Nov 2006
Posts: 3,095 Likes: 1
Carpal Tunnel
|
Carpal Tunnel
Joined: Nov 2006
Posts: 3,095 Likes: 1 |
Marquee tag {wikipedia} http://en.wikipedia.org/wiki/Marquee_tagComplianceThe marquee element type was first invented for Microsoft's Internet Explorer and is still supported. The Mozilla Firefox, Opera, and Safari web browsers support it for legacy page compatibility, although many other browsers do not. The tag is considered unofficial in proper XHTML or HTML. An equivalent for the tag is however being designed for the future releases of Cascading Style Sheets. [1] Similar effects can also be achieved through the use of JavaScript on a webpage.
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
Marquee tags are not xhtml compliant.
|
|
|
|
Joined: Jun 2006
Posts: 16,301 Likes: 116
|
Joined: Jun 2006
Posts: 16,301 Likes: 116 |
I really need to read page 2 before posting ...
|
|
|
2 members (Ruben, ahmed047),
754
guests, and
155
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|