BackgroundColor And Firefox
Jul 23, 2005
When I set the background colour of an element using
tdRef.style.backgroundColor and then read it back, Firefox always
gives rgb(r, g, b) regardless of whether I've used rgb(...) or #rrggbb
to set it.
If I use tdRef.bgColor to set/read the value, I always get #rrggbb
regardless of whether I've used rgb(...) or #rrggbb.
IE, on the other hand, when using style.backgroundColor reports back in
whatever format was used (either rgb(...) or #rrggbb), but, like
Firefox, always gives #rrggbb for the bgColor method.
My question is which method is most consistent across various browsers?
I want to use style.backgroundColor (since some browsers don't support
bgColor, I guess it's a legacy from the ver 4 browser days). If I
decide to use rgb(...), is it consistently supported by other browsers
or do some report in #rrggbb regardless? Code:
View 1 Replies
ADVERTISEMENT
Jun 26, 2006
I want to get the colour in HEX format using "thing.style.backgroundColor". Like "#FFFFFF" or whatever. IE gives this but FF gives it as "rgb(0,0,0)" format.
Is there a simple function/method of getting it as hex? (or a conversion function)
View 3 Replies
View Related
Aug 18, 2007
I have written a javascript version of tetris and at every 10th cleared line, I change the body background color more towards red. However, the page only seems to update parts of the background. It is only after min/maxing the window or otherwise forcing a redraw that the whole page background is actually updated to the correct color.
Any idea why this is and if/how this can be fixed?
This line works as expected, but it may be relevant to highlight.
document.body.style.backgroundColor = "rgb(255," +GB+ "," +GB+ ")";
View 1 Replies
View Related
Dec 4, 2009
I have this php generated table
for ($i=0; $i<=count($mat)-1; $i++)
{
echo '<tr id="tr'.$i.'" class="table_body" bgcolor="GhostWhite"onclick="changeColor(this.id)">';
echo '<td width="150">'.$mat[$i][0].'</td>';
[Code]...
View 3 Replies
View Related
Aug 31, 2011
I would like to do things. 1) to change text in span to "" and 2) to change background of it.When I click on anchor, so "Saved!" with green backround will appear. And it would disappear after 1500 ms.
View 10 Replies
View Related
Feb 8, 2010
I'm trying to compare a <div> background color with another color. However, on FireBug, I noticed that my <div> doesn't have a background color code in it (I placed document.getElementById(o) on watch), even though I have already specified on my css. As a result, I'm comparing an empty string with another color code. Why is this so ?
Javascript:
function highlight(o) {
var color1;
color1 = document.getElementById(o).style.backgroundColor;[code].....
View 2 Replies
View Related
Nov 24, 2010
I need help with an IE8 problem. I want to give as many facts as possible.
Reference: [url]
I have already banned less than IE8 from my site but have the following problem with IE8 only (works on Mac and Win in these"allowed" browsers:Safari 5+, Chrome, FF 3.5+ and Opera 10+):
I use the backgroundPosition setter / getter extensively in this animation-extensive site.
But it breaks in IE8.
I did hack this as the only way I could get IE8 to work in a frame animation algorithm, noting that I have to test for browser and version (ugh) and then use this getter:
The following is an example that appears to work but seems unstable to me: (note that "accordionState"references an object within a data store attached to the "page" element):
There are many other cases where I have get or setbackgroundPosition,especially in the 'over' and out' functions where I use hoverIntent.
As a great fan and user of jQuery, I am puzzled that this will not work in IE8. Note thatbackgroundColor does not work either, although I do use UI to do these sorts of things and it seems to work in IE.
View 1 Replies
View Related
Aug 31, 2011
I have such code:
<a href='localhost' onclick='$.post("index.php?action=ax&save=1", { tname: "basic", rid: "3", col:"id", val:$(this).prev().val() } );$(this).next().html(" Saved!"); return false;'>Save!</a>
[code]....
View 5 Replies
View Related
Oct 5, 2011
There is a live search on my web page but the box of available options which falls below the 'input' field has a transparent background color. How can it be changed to non-transparent?This line below makes the background white, but all the text on the page shines through, since the default is transparent.
[CODE]
document.getElementById("linksearch").style.backgroundColor="#FFFFFF";
[CODE]
This instruction line does not help much 'cos I can't figure out the correct way to make it work:
[CODE]
View 22 Replies
View Related
Sep 23, 2009
i want to animate the backgroundcolor of the <body> when the page is loaded. It works - but sometimes when i switch from one page to another or if i just reload a page, it doesnt change.First i used this script:
<script>
$(window).load(function(){
$("body").animate({ backgroundColor: "#bdc58f" }, 1000);[code].....
But it doesn't make any difference - both are working generally, but sometimes if i load a page it doesnt change the color.
View 5 Replies
View Related
Apr 12, 2011
I would like to select all input elements on a page in which have a specific background-color.How would I go about doing that?
View 7 Replies
View Related
Apr 18, 2011
Whats wrong with this script. It works in IE, but not in Firefox. I get no error codes it just simply does not display the text in Firefox.
Code:
View 2 Replies
View Related
Oct 1, 2005
I use the code below to show the year on my sites e.g. this page.
However, instead of 2005 it shows 105 in Firefox.
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var year=time.getYear();
document.write("" + year + "");
// End -->
</SCRIPT>
Works fine in Internet Explorer.
How can I show the correct year in Firefox as well please?
View 3 Replies
View Related
Mar 26, 2009
First the code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title></title>
<script type="text/javascript">
function TextScroll(scrollname, div_name, up_name, down_name, top_name){
[Code]...
When I use mouse wheel in Firefox to scroll contents of the DIV, memory usage in Firefox goes through the roof. Code above is a fully working page, if anyone would like to see what's up, just load it up, and start moving your mouse wheel in the area with text. You don't actually have to scroll the text, just moving the wheel back and forth in that DIV will do. Memory usage will start going up quite fast, and after you stop moving the wheel, it will finally come down a bit after a short while. I've highlighted in red the line where mousewheel event is registered for Firefox. I'm not sure if it's really a problem, but since Opera and IE don't have any strange memory usage, and Firefox does, maybe I did something wrong. In everyday use it shouldn't matter [don't expect to have kilometers of content to scroll], but anyway, it is a bit unsettling.
View 2 Replies
View Related
Jan 7, 2006
if ((window)&&(window.netscape)&&(window.netscape.security)) {
// OK, this is Gecko/Firefox or someone mimicing it so well
// that there is no way to catch it on the act.
}
But I need Firefox *1.5 or higher* or another (but sure) way to know
that this browser has native SVG support. Here I'm stock.
It seems there is window.navigator.productSub and on my Firefox 1.5
it's 20051111
But I'm not sure: this "build version" is going up guaranteed or it's
random like CLASSID? Also is the same Firefox release has the same
build for all platforms or not? mozilla.org seems silent.
View 9 Replies
View Related
Oct 24, 2005
It's possible to disable then online help in Firefox
when I press F1 key, using 'onkeypress' or 'onkeydown'
event?
View 2 Replies
View Related
Aug 21, 2007
This "show-hide" works in IE7 but fails in FF2 -
Error in FF: "this.children is not a function"
<DIV id=sect style="display:block;" onclick="javascript:if
(this.children(0).style.display=='none'){this.chil dren(0).style.display='block'}else{this.children(0 ).style.display='none'}">
<Table>
<TR>
<TD>xxxx<TD>
</TR>
</Table>
</DIV>
View 2 Replies
View Related
Jul 14, 2009
I have a BETA site that I'm testing. It looks good/works fine in IE, but Firefox has some troublesome breakages that I can't figure out how to fix without breaking IE. The one I'm most concerned about is that I have a video player that was working a couple of weeks ago, and several revisions to the page later (not the video iframe), it's not. Works great in IE, but in Firefox, the controls in the video player are either sticky or do not work altogether. The video is called through an iframe (needs to be done that way by request) and the embed is as such:
<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>[code]....
I have also tried it with the following parameter, and it still didn't work in FF, but it didn't seem to affect it in IE:
so.addParam("type", "application/x-shockwave-flash");
What kind of front page revision (the page containing the iframe) might have changed this? Is it a recent FF update?
View 3 Replies
View Related
Feb 6, 2006
I have some menu items which i use javascript to change the image on mouse over. This works fine in IE, and used to work fine in Firefox.
However I added an few extra menu items near the bottom and something has gone a bit wrong. The last 4 menu items dont change image in firefox or netscape... but they work fine in IE. Code:
View 3 Replies
View Related
Jul 23, 2005
My document had the following nested DIV structure, with a possible
<SPAN> between the DIV and the <A> elements:
<div id="container">
<div id="D1">
<span>blah blah</span><br>
<A id="A1">item</a><br>
View 4 Replies
View Related
Jul 23, 2005
I'm trying to find a simple step-by-step on how to read a simple XML file
like this one, which will work in IE 6 and Firefox 0.x.
<?xml version="1.0" encoding="ISO-8859-1"?>
<CATALOG>
<CD>
<TITLE>Empire Burlesque</TITLE>
<ARTIST>Christopher Santee</ARTIST>
<COUNTRY>USA</COUNTRY>
<COMPANY>Columbia</COMPANY>
<PRICE>10.90</PRICE>
<YEAR>1985</YEAR>
</CD>
<CATALOG>
The problem is every example, I find that it will work in IE but not Firefox
or visa versa, could someone please point me to a how to that will work with
both browsers. I just spent two weeks reading the Microsoft Press Book "XML
Step by Step", only to find out that the technology only works with IE.
View 1 Replies
View Related
Jul 23, 2005
I have the script below, which is supposed to populate a text box
on a form which opened this popup window - it should then call a
function 'PostThisPage' on the opener document, and then close the
current window/popup.
This works ok in IE - can anyone please help me by pointing out what it
needs to become cross-browser compatible? It doesn't work in Firefox
1.0.
<script>
window.opener.document.forms(0).tbGoToDate.value = 񟭄-11-11'
window.opener.PostThisPage();
window.close();
</script>
View 2 Replies
View Related
Jul 23, 2005
Here is my problem in a nutshell: a script to model dynamic table
extension. It works under Firefox. But IE just aborts, complaining about
an "unknown runtime error" in the line with "innerHTML". Why?
<html><head></head><body>
<script language="javascript">
function extend() {
var tb = document.getElementById('thetable').tBodies[0];
var newrow = document.createElement('tr');
tb.insertBefore(newrow,tb.rows[tb.rows.length-1]);
tb.rows[tb.rows.length-2].innerHTML =
'<td>A</td><td>dummy</td><td>row</td>'
}
</script>
<table id="thetable">
<tr><td>1-1</td><td>1-2</td><td>1-3</td></tr>
<tr><td>2-1</td><td>2-2</td><td>2-3</td></tr>
<tr><td>3-1</td><td>3-2</td><td>3-3</td></tr>
<tr><td colspan="3"><a href="javascript:extend();">extend</a></td></tr>
</table>
</body>
</html>
View 1 Replies
View Related
Jul 23, 2005
Does anyone know how I can fix the code below to work in Firefox,it
works perfectly well in IE, the problem is that I have to use Firefox
for this assignment....
View 3 Replies
View Related
Jul 23, 2005
JavaScripties:
On the HTML side, we load an IFRAME with a blank page:
<iframe frameborder="0" marginwidth="0" marginheight="0" scrolling="off"
src="about:blank" id="iframe_xml1!format_text"
name="iframe_xml1!format_text" width="90%" height=" 180 ">Your browser is
inferior and doesn't support IFRAMEs.</iframe>
Later, a button click populates this frame:
var iframe = window.frames[iframeName];
iframe.src = outputUrl;
That works on IE but not FireFox. Any tips?
View 6 Replies
View Related
Jul 23, 2005
Why doesn't a SELECT element's innerHTML reflected which option was
selected? Works in IE. I need this functionality so that I can retain
what choices a user made in a tabbed interface.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://w3.org/1999/xhtml">
<head>
<script language="javascript">
function callAlert(){
var theHTML = document.getElementById('Radius').innerHTML;
//alert(theHTML);
}
</script>
<title>Untitled Document</title>
</head>
<body>
<form id="myForm">
<div id="myDiv">
<table border="0" width="430" cellpadding="3" cellspacing="0">
<tr>
<td font color="#ff0000">*</font>Radius:</td>
<td width="331" height="30" class="formData">
<select onChange="callAlert();" id="Radius" name="Radius">
<option value=".10" id="0">1/10 mile</option>
<option value=".20">1/5 mile</option>
<option value=".25">1/4 mile</option>
<option value=".5">1/2 mile</option>
<option value=".75">3/4 mile</option>
<option value="1">1 mile</option>
</select>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
View 24 Replies
View Related