Помощник
|
узнать значение display |
Mutant
|
Сообщение
#1
|
||
|
|
||
|
|||
Exterior |
6.8.2008, 13:13;
Ответить: Exterior
Сообщение
#2
|
|
Mutant,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251" /> <title>Определние значений у CSS свойств</title> <!-- Style CSS --> <style type="text/css"> <!-- .test_div { width: 200px; height: 200px; margin-bottom: 10px; display: block; background: #00CC66; border: solid 1px black; } --> </style> <!-- JavaScript --> <script type="text/javascript"> <!-- function getElementComputedStyle(elem, prop) { if (typeof elem!="object") elem = document.getElementById(elem); if (document.defaultView && document.defaultView.getComputedStyle) { if (prop.match(/[A-Z]/)) prop = prop.replace(/([A-Z])/g, "-$1").toLowerCase(); return document.defaultView.getComputedStyle(elem, "").getPropertyValue(prop); } if (elem.currentStyle) { var i; while ((i=prop.indexOf("-"))!=-1) prop = prop.substr(0, i) + prop.substr(i+1,1).toUpperCase() + prop.substr(i+2); return elem.currentStyle[prop]; } return ""; } function getAttrValue(ID, Attribute) { var varAttr = getElementComputedStyle(ID, Attribute); alert(varAttr); } //--> </script> </head> <body> <div class="test_div" id="test_div"></div> <input type="button" value="View Attribute Value" onclick="getAttrValue('test_div', 'display');" /> </body> </html> |
|
|
Mutant
|
Сообщение
#3
|
|
|
спасибо огромное
|
|
|
||
|
Похожие темы
Тема | Ответов | Автор | Просмотров | Последний ответ | |
---|---|---|---|---|---|
Как поисковик реагирует на display none? Сабж. |
13 | stixia007 | 4491 | 14.9.2018, 15:56 автор: falselight |
|
Хочу узнать актуальность сервиса кросспостинга в твиттер ? | 1 | regem | 3248 | 26.4.2017, 13:53 автор: ktulhu |
|
Значение чекбокса сразу добавляется в тектовое поле | 2 | mixxxxxx | 3167 | 3.11.2014, 11:25 автор: -mixxxxxx- |
|
Хотелось бы узнать мнение, на счет статейных прогонов | 25 | regem | 9697 | 10.10.2014, 13:59 автор: regem |
|
Как узнать стоимость работы рерайтера? | 13 | AutoDrom | 3149 | 17.3.2014, 13:50 автор: Sosnovskij |
Текстовая версия | Сейчас: 23.4.2024, 10:40 |