is there any function in java to make the text to blink?
Answer Posted / praveena tadiboyina
for above blink in different colours here it is
<%@ page contentType="text/html;charset=windows-1252"%>
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
var count=0;
var color=new Array
("#8B0000","#00C7FF","#2F4F4F","#FF8C00","#BDB76B");
window.onerror = null;
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);
var NS4 = (bName == "Netscape" && bVer >= 4);
var IE4 = (bName == "Microsoft Internet Explorer"
&& bVer >= 4);
var NS3 = (bName == "Netscape" && bVer < 4);
var IE3 = (bName == "Microsoft Internet Explorer"
&& bVer < 4);
var blink_speed=100;
var i=0;
if (NS4 || IE4) {
if (navigator.appName == "Netscape") {
layerStyleRef="layer.";
layerRef="document.layers";
styleSwitch="";
}else{
layerStyleRef="layer.style.";
layerRef="document.all";
styleSwitch=".style";
}
}
//BLINKING
function Blink(layerName){
var mtext=document.getElementById("mytext");
mtext.style.color=color[count];
count++;
if(count > 4)
{
count=0;
}
if (NS4 || IE4) {
if(i%2==0)
{
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="visible"');
}
else
{
eval(layerRef+'["'+layerName+'"]'+
styleSwitch+'.visibility="hidden"');
}
}
if(i<1)
{
i++;
}
else
{
i--
}
setTimeout("Blink('"+layerName+"')",blink_speed);
}
</script>
</HEAD>
<BODY>
<div id="prem_hint" style="position:relative; left:0;
visibility:hidden" class="prem_hint">
<b>
<span id="mytext">Welcome to the JavaScript Source!</span>
</b>
</div>
<script language="javascript">Blink('prem_hint');</script>
<p><center>
<font face="arial, helvetica" size"-2">The JavaScripts
provided<br>
by <a href="http://javascriptsource.com">The JavaScript
Source</a></font>
</center><p>
</BODY>
</HTML>
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is the difference between the final method and abstract method?
What does sprintf mean?
How do you compare characters in java?
Differentiate between array list and vector in java.
What is 32 bit float?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
What language is an assembler written in?
What is charat java?
Why string is immutable or final in java
What is codebase?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
How do you declare a destructor in java?
What is the memory leak in java?
How to sort an array from smallest to largest java?
How to make a non daemon thread as daemon?