I figured it out:
function changeStrokeColor(e) { document.getElementById("MSSA").setAttribute('style', e == "MSSA" ? 'font-family:Verdana;font-size:1.4px;stroke-width:0.015px;fill:#E10000;stroke:#E10000;stroke-linecap:round;stroke-linejoin:round' : 'font-family:Verdana;font-size:1.4px;stroke-width:0.015px ;fill:gray;stroke:gray;stroke-linecap:round;stroke-linejoin:round'); //document.getElementById("MSSA").setAttribute('style', 'font-family:Verdana;font-size:1.4px;stroke-width:0.015px ;fill:red;stroke:red;stroke-linecap:round;stroke-linejoin:round'); document.getElementById("BFRJAM").setAttribute('style', e == "BFRJAM" ? 'font-family:Verdana;font-size:1.4px;stroke-width:0.015px;fill:#E10000;stroke:#E10000;stroke-linecap:round;stroke-linejoin:round' : 'font-family:Verdana;font-size:1.4px;stroke-width:0.015px ;fill:gray;stroke:gray;stroke-linecap:round;stroke-linejoin:round'); //document.getElementById("BFRJAM").setAttribute('style', 'font-family:Verdana;font-size:1.4px;stroke-width:0.015px ;fill:red;stroke:red;stroke-linecap:round;stroke-linejoin:round'); } Thanks for your help Martin. kmartin7 On 9/7/06, Kurt Martin <[EMAIL PROTECTED]> wrote: > > Here is my dilemma. I have pasted a portion of the code to show what I > have: > > *********************************************************** > > <?xml version="1.0" encoding="UTF-16"?> > > <svg version="1.1" onload="InitContextMenu()" > preserveAspectRatio="xMidYMid" > xml:space="preserve" viewBox="-0.317924 -8.41906 14.3537 8.07632" > width="100%" height="100%" xmlns:svg="http://www.w3.org/2000/svg" xmlns=" > http://www.w3.org/2000/svg" xmlns:cs="http://www.aftercad.com/cad" > xmlns:xlink="http://www.w3.org/1999/xlink"> > > <g id="MSSA" style="font-family:Verdana;font-size:1.4px;stroke-width: > 0.015px > > > ;fill:#666666;;fill-rule:nonzero;stroke:gray;stroke-linecap:round;stroke-linejoin:round"> > > <set attributeName="stroke" to="#E10000" begin="click" end="mouseup+0.1" > /> > > <set attributeName="fill" to="#E10000" begin="click" end="mouseup+0.1" /> > > <set attributeName="stroke-width" to="0.015px" begin="click" end="click" > /> > > <set attributeName="stroke" to="#FFCC00" begin="mouseover" end="mouseout" > /> > > <set attributeName="fill" to="#FFCC00" begin="mouseover" end="mouseout" /> > > <set attributeName="stroke-width" to="0.0175px" begin="mouseover" > end="mouseout" /> > > <text transform="matrix(0.0625 0 0 0.0625 2.4181 -6.79844)">MSSA</text> > > <polyline points="2.35757679,-6.7587878 2.89307391,-6.7587878 " /> > > <polyline points="2.89169731,-6.75798446 2.79984604,-6.80844657 " /> > > <polyline points="2.89169731,-6.75798442 2.79984604,-6.7075223 " /> > > <polyline points="2.80198692,-6.80727039 2.80198692,-6.80454195 " /> > > <polyline points="2.88609042,-6.76106483 2.88609042,-6.75490405 " /> > > <polyline points="2.88048351,-6.7641452 2.88048351,-6.75182368 " /> > > <polyline points="2.8748766,-6.76722558 2.8748766,-6.7487433 " /> > > <polyline points="2.86926969,-6.77030596 2.86926969,-6.74566292 " /> > > <polyline points="2.86366278,-6.77338633 2.86366278,-6.74258255 " /> > > <polyline points="2.85805587,-6.77646671 2.85805587,-6.73950217 " /> > > <polyline points="2.85244896,-6.77954709 2.85244896,-6.73642179 " /> > > <polyline points="2.84684205,-6.78262746 2.84684205,-6.73334141 " /> > > <polyline points="2.84123514,-6.78570784 2.84123514,-6.73026103 " /> > > <polyline points="2.83562823,-6.78878822 2.83562823,-6.72718066 " /> > > <polyline points="2.83002133,-6.79186859 2.83002133,-6.72410029 " /> > > <polyline points="2.82441445,-6.79494895 2.82441445,-6.72101993 " /> > > <polyline points="2.81880757,-6.79802931 2.81880757,-6.71793956 " /> > > <polyline points="2.81320068,-6.80110967 2.81320068,-6.7148592 " /> > > <polyline points="2.8075938,-6.80419003 2.8075938,-6.79163024 " /> > > <polyline points="2.80198692,-6.71142694 2.80198692,-6.70869848 " /> > > <polyline points="2.8075938,-6.72433865 2.8075938,-6.71177884 " /> > > <path d="M2.8133673,-6.75798445 A0.100924331,0.100924331 0 0,0 2.79984602 > ,- > 6.80844659 " /> > > <path d="M2.79984602,-6.7075223 A0.100924331,0.100924331 29.9999874 0,0 > 2.8133673,-6.75798442 " /> > > </g> > > <g id="BFRJAM" style="font-family:Verdana;font-size:1.4px;stroke-width: > > 0.015px > > ;fill:#666666;;fill-rule:nonzero;stroke:gray;stroke-linecap:round;stroke-linejoin:round"> > > <set attributeName="stroke" to="#E10000" begin="click" end="mouseup+0.1" > /> > > <set attributeName="fill" to="#E10000" begin="click" end="mouseup+0.1" /> > > <set attributeName="stroke-width" to="0.015px" begin="click" end="click" > /> > > <set attributeName="stroke" to="#FFCC00" begin="mouseover" end="mouseout" > /> > > <set attributeName="fill" to="#FFCC00" begin="mouseover" end="mouseout" /> > > <set attributeName="stroke-width" to="0.0175px" begin="mouseover" > end="mouseout" /> > > <text transform="matrix(0.0625 0 0 0.0625 3.20609 -4.51071)">DEMO_D</text> > > <polyline points="3.04783893,-4.47718498 3.9368703,-4.47718498 " /> > > <polyline points="3.9353936,-4.47694294 3.84354233,-4.52740505 " /> > > <polyline points="3.9353936,-4.47694289 3.84354233,-4.42648078 " /> > > <polyline points="3.84568322,-4.52622887 3.84568322,-4.52350042 " /> > > <polyline points="3.92978672,-4.4800233 3.92978672,-4.47386253 " /> > > <polyline points="3.9241798,-4.48310367 3.9241798,-4.47078215 " /> > > <polyline points="3.91857289,-4.48618406 3.91857289,-4.46770177 " /> > > <polyline points="3.91296598,-4.48926443 3.91296598,-4.4646214 " /> > > <polyline points="3.90735907,-4.49234481 3.90735907,-4.46154102 " /> > > <polyline points="3.90175216,-4.49542519 3.90175216,-4.45846064 " /> > > <polyline points="3.89614525,-4.49850556 3.89614525,-4.45538027 " /> > > <polyline points="3.89053834,-4.50158594 3.89053834,-4.45229989 " /> > > <polyline points="3.88493143,-4.50466632 3.88493143,-4.44921951 " /> > > <polyline points="3.87932452,-4.5077467 3.87932452,-4.44613913 " /> > > <polyline points="3.87371762,-4.51082707 3.87371762,-4.44305876 " /> > > <polyline points="3.86811074,-4.51390743 3.86811074,-4.4399784 " /> > > <polyline points="3.86250386,-4.51698779 3.86250386,-4.43689804 " /> > > <polyline points="3.85689698,-4.52006815 3.85689698,-4.43381768 " /> > > <polyline points="3.8512901,-4.52314851 3.8512901,-4.51058872 " /> > > <polyline points="3.84568322,-4.43038542 3.84568322,-4.42765696 " /> > > <polyline points="3.8512901,-4.44329713 3.8512901,-4.43073732 " /> > > <path d="M3.8570636,-4.47694292 A0.100924331,0.100924331 0 0,0 3.84354231 > ,- > 4.52740507 " /> > > <path d="M3.84354231,-4.42648078 A0.100924331,0.100924331 29.9999874 0,0 > 3.8570636,-4.47694289 " /> > > <polyline points="3.04555034,-4.48117033 3.04555034,-4.48117033 " /> > > <polyline points="3.04555034,-4.52355325 3.03491277,-4.51400182 " /> > > <polyline points="3.03491277,-4.51400182 3.02965674,-4.50236181 " /> > > <polyline points="3.02965674,-4.50236181 3.03452707,-4.49141797 " /> > > <polyline points="3.03452707,-4.49141797 3.04555034,-4.48117033 " /> > > <polyline points="3.04555034,-4.48117033 3.0565736,-4.4709227 " /> > > <polyline points="3.0565736,-4.4709227 3.06144391,-4.45997886 " /> > > <polyline points="3.06144391,-4.45997886 3.0561879,-4.44833884 " /> > > <polyline points="3.0561879,-4.44833884 3.04555034,-4.43878741 " /> > > </g> > > <script language="javascript">//replace standard context menu with custom > menu > > function InitContextMenu() > > { > > var newMenuRoot = parseXML(printNode(document.getElementById > ('myCustomMenu')), > contextMenu); > > contextMenu.replaceChild( newMenuRoot, contextMenu.firstChild ); > > } > > function showAll() > > { > > document.getElementById("MSSA").setAttribute('visibility', 'visible'); > > document.getElementById("BFRJAM").setAttribute('visibility', 'visible'); > > //document.getElementById("NOT22").setAttribute('visibility', 'visible'); > > //document.getElementById("NOT12").setAttribute('visibility', 'visible'); > > //document.getElementById("HALT2").setAttribute('visibility', 'visible'); > > //document.getElementById("LSTOB").setAttribute('visibility', 'visible'); > > //document.getElementById("BFREMSTOP").setAttribute('visibility', > 'visible'); > > //document.getElementById("LSTOLB").setAttribute('visibility', 'visible'); > > //document.getElementById("LSTORB").setAttribute('visibility', 'visible'); > > //document.getElementById("V24P HALT").setAttribute('visibility', > 'visible'); > > //document.getElementById("BFSEMSTOP").setAttribute('visibility', > 'visible'); > > //document.getElementById("24V NOT").setAttribute('visibility', > 'visible'); > > //document.getElementById("HALTO").setAttribute('visibility', 'visible'); > > > } > > function show(s) > > { > > document.getElementById("MSSA").setAttribute('visibility', s == "MSSA" ? > 'visible' : 'hidden'); > > document.getElementById("BFRJAM").setAttribute('visibility', s == "BFRJAM" > ? > 'visible' : 'hidden'); > > //document.getElementById("NOT22").setAttribute('visibility', s == "NOT22" > ? > 'visible' : 'hidden'); > > //document.getElementById("NOT12").setAttribute('visibility', s == "NOT12" > ? > 'visible' : 'hidden'); > > //document.getElementById("HALT2").setAttribute('visibility', s == "HALT2" > ? > 'visible' : 'hidden'); > > //document.getElementById("LSTOB").setAttribute('visibility', s == "LSTOB" > ? > 'visible' : 'hidden'); > > //document.getElementById("BFREMSTOP").setAttribute('visibility', s == > "BFREMSTOP" ? 'visible' : 'hidden'); > > //document.getElementById("LSTOLB").setAttribute('visibility', s == > "LSTOLB" > ? 'visible' : 'hidden'); > > //document.getElementById("LSTORB").setAttribute('visibility', s == > "LSTORB" > ? 'visible' : 'hidden'); > > //document.getElementById("V24P HALT").setAttribute('visibility', s == > "V24P > HALT" ? 'visible' : 'hidden'); > > //document.getElementById("BFSEMSTOP").setAttribute('visibility', s == > "BFSEMSTOP" ? 'visible' : 'hidden'); > > //document.getElementById("24V NOT").setAttribute('visibility', s == "24V > NOT" ? 'visible' : 'hidden'); > > //document.getElementById("HALTO").setAttribute('visibility', s == "HALTO" > ? > 'visible' : 'hidden'); > > }</script> > > <svg:defs> > > <menu id="myCustomMenu"> > > <header>Custom MTSC Menu</header> > > <item action="ZoomIn">Zoom &In</item> > > <item action="ZoomOut">Zoom &Out</item> > > <item action="OriginalView">Original Vie&w</item> > > <separator /> > > <item action="Quality">Higher &Quality</item> > > <separator /> > > <item action="Find">&Find...</item> > > <item action="FindAgain">Find &Again</item> > > <item action="Copy">&Copy Selected Text</item> > > <separator /> > > <item onactivate="javascript:location.reload();">Reset</item> > > <separator /> > > <menu> > > <header>Show Signals</header> > > <item onactivate="showAll()">Show All Signals</item> > > <separator /> > > <item onactivate="show('MSSA')">MSSA</item> > > <item onactivate="show('BFRJAM')">BFRJAM</item> > > <!--<item onactivate="show('NOT22')">NOT22</item> > > <item onactivate="show('NOT12')">NOT12</item> > > <item onactivate="show('HALT2')">HALT2</item> > > <item onactivate="show('LSTOB')">LSTOB</item> > > <item onactivate="show('BFREMSTOP')">BFREMSTOP</item> > > <item onactivate="show('LSTOLB')">LSTOLB</item> > > <item onactivate="show('LSTORB')">LSTORB</item> > > <item onactivate="show('V24P HALT')">V24P HALT</item> > > <item onactivate="show('BFSEMSTOP')">BFSEMSTOP</item> > > <item onactivate="show('24V NOT')">24V NOT</item> > > <item onactivate="show('HALTO')">HALTO</item>--> > > </menu> > > <separator /> > > <item action="SaveAs">&Save SVG As...</item> > > <separator /> > > <item action="Help">&Help...</item> > > <item action="About">A&bout SVG Viewer...</item> > > </menu> > > </svg:defs> > > </svg> > > *********************************************************** > > What I need to do is to basically change stroke color to red whenever the > user chooses to view a signal (which subsequently turns off the other > layers). Since the stroke color is stored in the style attribute, I have > no > idea how to change it. I did read this: > > > http://archives.hwg.org/hwg-techniques/[EMAIL PROTECTED] > > In my utter stupidity, it took me two days to realize that I couldn't > change > the stroke color because the info was contained in a style attribute. Does > anyone know how to access the style attribute? > kmartin7 > > > On 9/7/06, Kurt Martin <[EMAIL PROTECTED] <kmartin7%40gmail.com>> wrote: > > > > Ahhhhhhhhhhhhhhhhh! > > > > I have been so engrossed about getting this done on time, I just > realized > > that the color is set by a style attribute. Now a totally different > quandry: > > how can I only access reset the color in the style attribute? Here is my > > style string: > > > > > > font-family:Verdana;font-size:1.4;stroke-width:0.015px > > > ;fill:#666666;;fill-rule:nonzero;stroke:gray;stroke-linecap:round;stroke-linejoin:round > > Surely it isn't" > > > > > > element.setAttributeNS(null, 'style', 'font-family:Verdana;font-size:1.4 > > ;stroke-width:0.015px > > > ;fill:#666666;;fill-rule:nonzero;stroke:gray;stroke-linecap:round;stroke-linejoin:round'); > > > > ???? > > > > > > > > On 9/7/06, Martin Honnen <[EMAIL PROTECTED]<honnen_martin%40yahoo.com>> > wrote: > > > > > --- In svg-developers@yahoogroups.com<svg-developers%40yahoogroups.com> > <svg-developers%40yahoogroups.com>, > > > > "zedkineece" <[EMAIL PROTECTED]> wrote: > > > > > > > I am using ASV 3, and the 'item' element belongs to Adobe viewer's > > > > custom context menu option. > > > > > > > > There are no errors, and when I inserted your code, there are still > > > > no errors and no change in color. > > > > > > I am not able to tell where the problem is. Can you post a URL to the > > > SVG document where the problem occurs? > > > > > > I have made a simple test case following the documentation here > > > < http://wiki.svg.org/Context_Menu_Customization> > > > and that test case with the "Test green" item changing the stroke of a > > > circle element > > > < http://home.arcor.de/martin.honnen/svg/test2006090701.svg> > > > works for me without problems with Adobe SVG viewer 3 and IE 6. > > > > > > > > > > > > > > > > > -- > > > Kurt D. Martin > > 405.343.7116 (c) > > 405.759.3075 (h) > > > > -- > Kurt D. Martin > 405.343.7116 (c) > 405.759.3075 (h) > > [Non-text portions of this message have been removed] > > > -- Kurt D. Martin 405.343.7116 (c) 405.759.3075 (h) [Non-text portions of this message have been removed] ----- To unsubscribe send a message to: [EMAIL PROTECTED] -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ---- Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/