I'm trying to add some functionality to a stylesheet editor. I'd like 
the style that the editor is working on to highlight the page area it 
will effect. This is what I have, but it only works on  style IDs and 
not CLASSes. How can I effect styles by class? Is there a way to 
temporarily replace the sheet value with an override while I mouse 
over an object?

Thanks for any help in advance,

Michael



Here's a snippet of the style sheet:

div.box_members {  }
div.box_members div.content { color:#000000; background-color:#ace; }



In the CF code:

onmousedown="javascript:highlightLayer('div.box_members','border:3px 
dotted red;');"



The JavaScript function:

                 function highlightLayer(myAttribute,myStyle)
                 {
                         if (document.getElementById)
                         {
                                 // this is the way the standards work
                                 var style2 = 
document.getElementById(myAttribute).style;
                                 style2 = style2? "":myStyle;
                         }
                         else if (document.all)
                         {
                                 // this is the way old msie versions work
                                 var style2 = document.all[myAttribute].style;
                                 style2 = style2? "":myStyle;
                         }
                         else if (document.layers)
                         {
                                 // this is the way nn4 works
                                 var style2 = 
document.layers[myAttribute].style;
                                 style2 = style2? "":myStyle;
                         }
                 }





--------
Michael Muller
Admin, MontagueMA.net Website
work (413) 863-0030
cell (413) 320-5336
fax (518) 713-1569
skype: michaelBmuller
email [EMAIL PROTECTED]
http://www.MontagueMA.net

Eschew Obfuscation



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:11:3028
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/11
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:11
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.11
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to