Login  |  Register
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome, Guest. Please login or register.
Did you miss your activation email?

November 30, 2022, 12:59:59 AM

Login with username, password and session length
Members
  • Total Members: 3853
  • Latest: tty456
Stats
  • Total Posts: 193625
  • Total Topics: 21107
  • Online today: 43
  • Online ever: 3540
  • (September 02, 2022, 06:38:54 PM)
Users Online
Users: 0
Guests: 26
Total: 26

Author Topic: Make one or more of your boards stand out from the other by making it flash  (Read 2928 times)

0 Members and 1 Guest are viewing this topic.

knat

  • Guest
I have a special board that only active members get access to. I wanted it to draw attention to itself when the user gets access to it so i made it flash in red.

I am no coder but i got this thing to work pretty easy so i want to share  ;)

Put this script into a script block.. select no title and frame then it will be invisible.

Code: [Select]
<script language="JavaScript1.2" type="text/javascript">

/***********************************************
* Flashing Link Script- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var flashlinks=new Array()

function changelinkcolor(){
for (i=0; i< flashlinks.length; i++){
var flashtype=document.getElementById? flashlinks[i].getAttribute("flashtype")*1 : flashlinks[i].flashtype*1
var flashcolor=document.getElementById? flashlinks[i].getAttribute("flashcolor") : flashlinks[i].flashcolor
if (flashtype==0){
if (flashlinks[i].style.color!=flashcolor)
flashlinks[i].style.color=flashcolor
else
flashlinks[i].style.color=''
}
else if (flashtype==1){
if (flashlinks[i].style.backgroundColor!=flashcolor)
flashlinks[i].style.backgroundColor=flashcolor
else
flashlinks[i].style.backgroundColor=''
}
}
}

function init(){
var i=0
if (document.all){
while (eval("document.all.flashlink"+i)!=null){
flashlinks[i]= eval("document.all.flashlink"+i)
i++
}
}
else if (document.getElementById){
while (document.getElementById("flashlink"+i)!=null){
flashlinks[i]= document.getElementById("flashlink"+i)
i++
}
}
setInterval("changelinkcolor()", 1000)
}

if (window.addEventListener)
window.addEventListener("load", init, false)
else if (window.attachEvent)
window.attachEvent("onload", init)
else if (document.all)
window.onload=init

</script>

The script operates by extending all links on your page with three optional attributes, which you apply to the specific link you wish to flash. Here are the attributes:

id="flashlinkID" Enables flashing on the link. Replace "ID" with an integer starting from 0 and onwards, depending on the number of flashing links you have.
flashtype=? Sets the type of flash. Set to 0 for flashing on link text, 1 for flashing on link's background
flashcolor=? Sets the color of the flash. Input color name or hex value.

All three attributes should appear concurrently in the flashing link. For example:

<a href="test.htm" id="flashlink0" flashtype=0 flashcolor="green">Example 1[/url]

<a href="test.htm" id="flashlink1" flashtype=1 flashcolor="lime">Example 2[/url]

Now go and rename your board like this:

<a href="url to your board" id="flashlink1" flashtype=1 flashcolor="red">name of your board[/url]


Demo: [XXX PORNO CONTENT VIEW ON OWN RISK] www.gapeindex.dk

login: test
pass: test


Thanks to dynamicdrive.com for the script  8)