The salute to the Brave Officers
We Pray for our forces who are still fighting the terrorists without thinking about their lives and family just for us.
We can at least pray for them.. JAI HIND..
Regards,
LeewayHertz Team
style property followed by the specific value you’re looking for:
var intPosLeft = document.getElementById("left").style.left;
However, this only works if the CSS has been applied inline on the element. As we all (or at least most of us) have realized, having inline styles isn’t a very good and efficient approach. So then we move all our CSS to an external file and suddenly the style property return no values when checking it.
What the hell happened?
The style property is reserved for inline styles (ridiculous, if you ask me), so you need to find another way to do it. Of course, then, there’s one standard way and one Microsoft way.
I have put together a function named getStyle (yes, the name is supposed to be funny) to solve this issue for you:
I’ve updated one line for IE. The previous code worked fine as well, it’s just a matter of personal preference when it comes to code syntax.
function getStyle(oElm, strCssRule){
var strValue = "";
if(document.defaultView && document.defaultView.getComputedStyle){
strValue = document.defaultView.getComputedStyle(oElm, "").getPropertyValue(strCssRule);
}
else if(oElm.currentStyle){
strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
return p1.toUpperCase();
});
strValue = oElm.currentStyle[strCssRule];
}
return strValue;
}
It is then called, for instance, like this:
getStyle(document.getElementById("container"), "font-size");
The first parameter is an object reference to the element you want to check, the second is the CSS name of the property you want to know the rendered value for.
Interesting to know is that specific values will return a value even if it was applied by shorthand in the CSS. For example, this will work just fine:
/* Element CSS*/
div#container{
font: 2em/2.25em Verdana, Geneva, Arial, Helvetica, sans-serif;
}
var elementFontSize = getStyle(document.getElementById("container"), "font-size");An other interesting thing is that Firefox, Opera and Safari will returned the actual pixels of a font size applied with em, while IE only return the value in em.
This script has been tested to work in the following web browsers:
The reason that it doesn’t work in IE 5.0 is having a function in the replace method as a second parameter. You might want to put this in a try...catch clause if you expect any users with that version, like this:
try{
strCssRule = strCssRule.replace(/\-(\w)/g, function (strMatch, p1){
return p1.toUpperCase();
});
strValue = oElm.currentStyle[strCssRule];
}
catch(e){
// Used to prevent an error in IE 5.0
}
INDIRA GANDHI PRIYADARSHINI AWARD FOR EXCELLENCE, OUTSTANDING SERVICES, ACHIEVEMENTS AND CONTRIBUTION
On Wednesday, 19th November 2008, Indira Gandhi Priyadarshini Award 2008 honored to Akash Takyar for excellence, outstanding services, achievements and contribution in IT sector, at auditorium India International Centre, New Delhi. This integration was organized to mark the 89th Birth Anniversary of Late. Smt. Indira Gandhi, by National Unity Conference group for which the honorable chief guest- Minister of Labour and Employment Shri Oscar Fernandes. The other dignities included Governor of Orissa H.E Shri M.C. Bhandare, Former Election Commissioner G.V.G. Krishnamurty, Former Director Shri Joginder Singh, Secretary AICC Shri Tom Vadakkan and Mrs. Hema Gamang to speak on the occasion.
“Every young man would do well to remember that all successful businesses stand on the foundation of hard work.” Akash Takyar, a young CEO and founder of an IT company LeewayHertz Technologies Pvt. Ltd is recorded as one of the fastest growing entrepreneur of India. Despite of his young age, he is as much passionate and enthusiastic as one entrepreneur needs to be. “It is an honor to be included in the list of recipient of such an impressive group of people and to receive the prestigious “Indira Gandhi Priyadarshi Award 2008,” said “Akash Takyar”.
Akash Takyar, (born 26 October 1983, Delhi) is a computer programmer and young entrepreneur. Akash's tryst with computer began, when his father gifted him a desktop at the tender age of thirteen. Throughout his teenage life, when most of his friends were trying their hands at various outdoor games, he was busy marshalling his acumen in the ever expanding quantum of information technology. His father Kartikay, who is a famous Astrologer and Vastu expert, has always supported him for his dreams. Akash has completed his graduation and post graduation from IITM, Janak puri, Guru Gobind Singh Indraprastha University. He did his schooling from Little Angels Public School, Paschim Vihar, Delhi.
Recently he has also been nominated for the Best entrepreneur in TATA NEN Hottest Startups Awards 2008.
