Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 10th, 2007, 11:11 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default css and style atribute equivalents

Hi,

Can anyone provide me a link which demonstrates all css and style(scripting) atribute equivalents. For instance I want to know how I shall access the border-collapse css property of an object in javascript.

Best Regards
 
Old April 10th, 2007, 12:29 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

CSS in JavaScript is pretty consistent:

$obj.style.margin

$obj.style.borderCollapse

Hyphenated properties are always in camel case. Single word properties are always all lowercase.

Some more examples:

$obj.style.zIndex

$obj.style.borderLeft

The Mozilla proprietary properties (and those from other vendors) detract from that convention slightly:

-moz-border-radius is accessed in script as $obj.style.MozBorderRadius

HTH!



Regards,
Rich

--
Author,
Beginning CSS: Cascading Style Sheets For Web Design, 2nd Edition
CSS Instant Results

http://www.catb.org/~esr/faqs/smart-questions.html
 
Old April 11th, 2007, 05:26 AM
Friend of Wrox
 
Join Date: Sep 2004
Posts: 103
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot. Yet another question. How can I determin the space between the cells of a table having the table's object in hand...






Similar Threads
Thread Thread Starter Forum Replies Last Post
purpose of hash in CSS style crmpicco CSS Cascading Style Sheets 4 January 27th, 2018 08:34 AM
adding style via CSS to XML documents crmpicco XML 3 December 1st, 2006 11:50 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.