Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mislz28/public_html/wp-content/themes/css-faq-v2/timeweather/timeweather.php on line 19
8 May 2008

forum

Current User: Guest Login Register
Please consider registering

Search 
Search Forums:


 




динамическое обновление стиля

UserPost

12:37 am
June 23, 2008


trotil

New Member

posts 1

1

доброго времени суток

требуется добавить правило в лист стилей. Как это сделать? 


Например, поместить правило #box1 {border: 2px solid red;}.

12:38 am
June 23, 2008


hohol

Member

posts 35

2

Код:

function appendCSSRule(selector, style)
{
if (document.styleSheets)
{
if (document.styleSheets[0].insertRule) document.styleSheets[0].insertRule(selector+” { “+style+” }”, document.styleSheets[0].cssRules.length);
else if(document.styleSheets[0].addRule) document.styleSheets[0].addRule(selector, style, document.styleSheets[0].rules.length);
}
}

function insertCSSRule(selector, style, i)
{
if (document.styleSheets)
{
if (document.styleSheets[0].insertRule) document.styleSheets[0].insertRule(selector+” { “+style+” }”, i);
else if(document.styleSheets[0].addRule) document.styleSheets[0].addRule(selector, style, i);
}
}

appendCSSRule(”#box1″,”border: 2px solid red”);



Reply to Topic: динамическое обновление стиля

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 7 + 7        (Required)

Topic Reply:


 

About the CSS-FAQ forum

Currently Online:

3 Guests

Maximum Online: 20

Forums:

Groups: 3

Forums: 18

Topics: 397

Posts: 834

Members:

There are 1050 members

There are 1 guests

Top Posters:

abc - 57

genius - 47

shane - 46

glowlite.uk - 39

booster - 37

warren - 35

Administrator: admin | Moderators: admin


© Simple:Press Forum - Version 3.1.1 (Build 336)