|
hi.
I have a problem with javascript. i use something like that:
<style>
.foo { background-color:green; }
</style>
<input name="theName" class="foo" type=button onclick="getcolors(this)" id=":-(" value="click">
<input name="theName" style="background-color:green;" type=button onclick="getcolors(this)" id=":-)" value="click">
<script>
function getcolors(element) {
alert('Color of '+element.id+' = '+element.style.backgroundColor);
}
</script>
why cant i get the color if its from a class? it doesnt make sense to me. whats the difference of using a class ot using the style attribute.
i tested it on Opera and IE. both times only one button worked as expected.
|
|
|
I think you found a legitimate bug. I don't know what that doesn't work. It works if you use the same syntax to SET the background color, but not to retrieve or display it. Maybe it has to be cast to a string? I don't know and don't have a lot of time today to experiment. I thought, though, I should give you the courtesy of a reply. Your code looks correct, but doesn't work for me either.
|
|
|
|
|
IE:
style = element.currentStyle.backgroundColor;
MOZ:
style = document.defaultView.getComputedStyle(element, '').getPropertyValue("backgroundColor");
(Note; always return rgb(r,g,b) value.)
So..:
<script language="JavaScript" type="text/javascript">
function getcolors(element) {
alert('Color of '+element.id+' = '+getStyle(element));
}
function getStyle(el) {
if(el.currentStyle)
return el.currentStyle.backgroundColor;
if(document.defaultView)
return document.defaultView.getComputedStyle(el, '').getPropertyValue("background-color");
return "Don\'t know how to get color";
}
</script>
Returns:
IE: green
MOZ: rgb(0,128,0)
Br,
<Added>
...sorry slipped,:
in MOZ you must use the css property name.
Example: getPropertyValue("background-color"); and NOT getPropertyValue("backgroundColor");
|
|
MOZ: WRONG:
var style = document.defaultView.getComputedStyle(element, '').getPropertyValue("backgroundColor");
Coorect:
var style = document.defaultView.getComputedStyle(element, '').getPropertyValue("background-color");
|
|
|
Example: If I go to the home page, I want the "Home" left-menu link to be black, instead of red. However, I want this to be automated using javascript or something, so that the browser would see that I am currently viewing "index.html" (the Home page), and so that specific link should be black, not red. Similarily, if I visit the "Contact" page, because I am viewing contact.html and the link is "contact.html" in the menu, I want that link to be black, not red.Example: If I go to the home page, I want the "Home" left-menu link to be black, instead of red. However, I want this to be automated using javascript or something, so that the browser would see that I am currently viewing "index.html" (the Home page), and so that specific link should be black, not red. Similarily, if I visit the "Contact" page, because I am viewing contact.html and the link is "contact.html" in the menu, I want that link to be black, not red.
70-272 | 117-201 | JN0-570 | 156-315 | COG-112 | 117-202 | JK0-016 | HP2-Z06 | \ HP2-T19 | HP2-Q04 \ HP0-J33 | F50-531 | E20-501 | 000-966
|
|
|
Wonderful.
Share a website with you ,
put this url in google sirch
(http://www.aamall.us )
Believe you will love it.
We accept any form of payment
|
|
|
|
|
|
|
Finance is the science of funds management. The accepted areas of accounts are business finance scwcd dumps, claimed finance(private finance), and accessible finance. Accounts includes extenuative money and generally includes lending money. The acreage of accounts deals with the concepts of time, money, accident and how they are interrelated. It additionally deals with how money is spent and budgeted.
One angle of accounts is through individuals and business organizations, which drop money in a bank. The coffer again lends the money out to added individuals or corporations for burning or advance and accuse absorption on the loans 646-205 dumps.
Loans accept become more packaged for resale, acceptation that an broker buys the accommodation (debt) from a coffer or anon from a corporation. Bonds are debt instruments awash to investors for organizations such as companies, governments or charities. The broker can again authority the debt and aggregate the absorption or advertise the debt on a accessory market. Banks are the capital facilitators of allotment through the accouterment of credit, although clandestine equity, alternate funds, barrier funds, and added organizations accept become important as they advance in assorted forms of debt. Banking assets, accepted as investments, 000-107 dumps are financially managed with accurate absorption to banking accident administration to ascendancy banking risk. Banking instruments acquiesce abounding forms of securitized assets to be traded on balance exchanges such as banal exchanges, including debt such as bonds as able-bodied as disinterestedness in about traded corporations.
Central banks, such as the Federal Reserve System banks in the United States and Coffer of England in the United Kingdom, are able players in accessible finance, acting as lenders of aftermost resort as able-bodied as able influences on budgetary and acclaim altitude in the economy 646-230 dumps.
|
|
|
|
|
Today I found a wonderful website,the site contained:
wedding dresses
cheap wedding dresses
Junior Bridesmaid Dresses
Cheap Homecoming Dresses
Cheap Quinceanera Dresses
Inexpensive bridesmaid dresses
Wholesale wedding dress
Wholesale wedding dress
Discount wedding dresses
Cheap Maternity Wedding Dresses
A-Line Wedding Dresses
Cheap Couture Wedding Dresses
Cheap Beach Wedding Dresses
Cheap Casual Wedding Dresses
Cheap Simple Wedding Dresses
Cheap Modest Wedding Dresses
Cheap Special Occasion Dresses
Cheap Evening Dresses
Cheap Prom Dresses
Cheap Little Black Dresses
Cheap Plus Size Wedding Dresses
Pink Wedding Dresses
Cheap Wedding Party Dresses
Cheap Bridesmaid Dresses
Cheap Flower Girl Dresses
Cheap Mother of the Bride Dresses
victoria's secret,
cheap wedding dresses,wholesale wedding dress,Wedding dresses 2011,Plus Size Wedding Dress wholesale,Couture Wedding Dress wholesale,Formal Wedding Dress wholesale,Bridesmaid Dresses wholesale,Discount Bridesmaid Dress wholesale,Junior Bridesmaids Dresses wholesale,Maternity Bridesmaid Dress wholesale,Cocktail Dress wholesale,Prom Dress wholesale,Evening Dress wholesale,Sexy Evening Dress wholesale,Stardoll Dress wholesale,Quinceanera Dress wholesale,Mother of the Bride Dress,Flower Girl Dress,Wedding Accessories wholesale
|
|
|
|
|
A century ago, American farmers healthy breakfast and city-dwellers alike piled breakfast low calorie diet plan plates high with meat, potatoes, gravy, eggs, bread, and healthy breakfast ideas/strong> sometimes pastries. Not much has eggs breakfast recipe changed.A 21st century leisurely breakfast often healthy breakfast foods consists of sausage or bacon, eggs, fried potatoes, gravy, healthy breakfast cookie recipe and waffles or pancakes smothered healthy breakfast cereal choices in butter and syrup or topped with healthy breakfast recipes sweetened fruit compote low calorie breakfast recipes and whipped cream.This breakfast is high in saturated fat and low in vitamins and healthy breakfast diet for kids other important nutrients. People who engage average breakfast cereal choices in regular hard work similar to healthy breakfast choices our ancestors, like the Amish, might get away with diet breakfast recipes eating that diet, but the rest of healthy eating tips America is at healthy breakfast dishes for kids increased risk of obesity and chronic diseases, such as cancer and diabetes.Another typical breakfast hurriedly gobbled down healthy recipes for weight loss before children and adults rush out the door is breakfast recipes for kids a bowl of sugar-coated cereal. An alternate version is a pastry and a cup of Tips for Healthy Eating coffee. These foods are highly processed and Breakfast and Brunch Cookbook high in sugar. They fill the void and give you a healthy indian breakfast recipe quick flash of energy, but the effect is short lived. By healthy brekfast foods for girls mid-morning, you're tired wrap sandwich recipes and hungry. Not only are you Real Food for Healthy Kids consuming empty calories, but you're also increasing your risk of diabetes healthy breakfast menus kids and obesity.Eating regular meals — especially breakfast — every day is a good health habit. Breakfast kick-starts your metabolism, healthy snack foods kids provides fuel for your healthy snacks kids mind, and healthy breakfast fruits for kids cuts down on mid morning snacking. Most snack foods are breakfast and brunch cookbook morning high in calories, fat, sugar, easy breakfast casserole and salt, and low in nutrients. This is probably one reason why pictures of healthy food breakfast skippers tend to weigh more healthy food habits.
|
|
|
A century ago, American farmers healthy breakfast and city-dwellers alike piled breakfast low calorie diet plan plates high with meat, potatoes, gravy, eggs, bread, and healthy breakfast ideas/strong> sometimes pastries. Not much has eggs breakfast recipe changed.A 21st century leisurely breakfast often healthy breakfast foods consists of sausage or bacon, eggs, fried potatoes, gravy, healthy breakfast cookie recipe and waffles or pancakes smothered healthy breakfast cereal choices in butter and syrup or topped with healthy breakfast recipes sweetened fruit compote low calorie breakfast recipes and whipped cream.This breakfast is high in saturated fat and low in vitamins and healthy breakfast diet for kids other important nutrients. People who engage average breakfast cereal choices in regular hard work similar to healthy breakfast choices our ancestors, like the Amish, might get away with diet breakfast recipes eating that diet, but the rest of healthy eating tips America is at healthy breakfast dishes for kids increased risk of obesity and chronic diseases, such as cancer and diabetes.Another typical breakfast hurriedly gobbled down healthy recipes for weight loss before children and adults rush out the door is breakfast recipes for kids a bowl of sugar-coated cereal. An alternate version is a pastry and a cup of Tips for Healthy Eating coffee. These foods are highly processed and Breakfast and Brunch Cookbook high in sugar. They fill the void and give you a healthy indian breakfast recipe quick flash of energy, but the effect is short lived. By healthy brekfast foods for girls mid-morning, you're tired wrap sandwich recipes and hungry. Not only are you Real Food for Healthy Kids consuming empty calories, but you're also increasing your risk of diabetes healthy breakfast menus kids and obesity.Eating regular meals — especially breakfast — every day is a good health habit. Breakfast kick-starts your metabolism, healthy snack foods kids provides fuel for your healthy snacks kids mind, and healthy breakfast fruits for kids cuts down on mid morning snacking. Most snack foods are breakfast and brunch cookbook morning high in calories, fat, sugar, easy breakfast casserole and salt, and low in nutrients. This is probably one reason why pictures of healthy food breakfast skippers tend to weigh more healthy food habits.
|
|
|
|
|
|
|
|
|
|
|
|