|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
JS text color prob in Nscape
I have a bookmark script on my page which displays text in the intended green color in IE but the ctrl D comment for netscape users is in black only which will not show up on my dark bkgr pages. Since I am not going to change the background, is there a way to make the NS comment to be in a color which WILL show up? this code uses a text message as well as a graphic. code is below:
<div id="bookmark" style="position:absolute; left:200px; top:200px; width:200px; height:69px; z-index:10"> <body link="#66CC66" vlink="#66CC66" alink="#999999"> <font size="2" face="Arial"> <script> var txt = " <img src='images/its_favicon.gif' border='0'><br>Bookmark something" var url = "http://www.something.com"; var who = "ITS" var ver = navigator.appName var num = parseInt(navigator.appVersion) if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) { document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" '); document.write('onMouseOver=" window.status=') document.write("txt; return true ") document.write('"onMouseOut=" window.status=') document.write("' '; return true ") document.write('">'+ txt + '</a>') }else{ txt += " (Ctrl+D)" document.write(txt) } </script></font> </div> |
|
#2
|
|||
|
|||
|
Hi,
Since its not a link and the color is based upon your a attributes in the body tag it isn't working. There's a way around it though if you include a fontcolor() method at the end of the txt string: Code:
<script>
var txt = " <img src='images/its_favicon.gif' border='0'>"
txt += "<br>Bookmark something".fontcolor('#66cc66');
var url = "http://www.something.com";
var who = "ITS"
var ver = navigator.appName
var num = parseInt(navigator.appVersion)
if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
document.write('onMouseOver=" window.status=')
document.write("txt; return true ")
document.write('"onMouseOut=" window.status=')
document.write("' '; return true ")
document.write('">'+ txt + '</a>')
}else{
txt += " (Ctrl+D)".fontcolor('#66cc66');
document.write(txt)
}
</script>
- Invoked Last edited by Invoked : March 23rd, 2003 at 10:20 PM. |
|
#3
|
|||
|
|||
|
THANK YOU! ...Much Appreciated! Hope i can return the favor.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > JS text color prob in Nscape |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|