Loading ...
Sorry, an error occurred while loading the content.

Re: Firefox2 vs Firefox3 (code)

Expand Messages
  • Frank Bruder
    My guess would be that the element with an empty xlink:href attribute causes the browser to reload the same document when you click it, after the code got
    Message 1 of 4 , Dec 18, 2008
    • 0 Attachment
      My guess would be that the <a> element with an empty xlink:href
      attribute causes the browser to reload the same document when you
      click it, after the code got executed.
      Try replacing the <a> with <g style="cursor:pointer;">
      Hopefully that'll fix it.


      Regards,
      Frank

      --- In svg-developers@yahoogroups.com, "jgfa92004" <juliegautier@...>
      wrote:
      >
      > Hi again,
      > Here is an example of code that works under FF2 but not anymore under
      > FF3 (and works under IE7).
      > Under FF3, the colors change and the checkbox is checked but then
      > everything is reverted...
      > Thanks for your help.
      > Julie
      >
      > <?xml version="1.0" standalone="no"?>
      > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG
      > 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
      > <svg stroke-dasharray="none" shape-rendering="auto" onload="init()"
      > id="main" font-family="" width="1000.0px" text-rendering="auto" fill-
      > opacity="1" contentScriptType="text/ecmascript" color-
      > interpolation="auto" color-rendering="auto"
      > preserveAspectRatio="xMidYMid meet" font-size="12" viewBox="0 0
      > 10000.0 6000.0" fill="black" stroke="" image-rendering="auto" stroke-
      > miterlimit="10" zoomAndPan="disable" version="1.0" stroke-
      > linecap="square" stroke-linejoin="miter" contentStyleType="text/css"
      > font-style="normal" height="600.0px" stroke-width="1" stroke-
      > dashoffset="0" font-weight="normal" stroke-opacity="1"
      > xmlns:xlink="http://www.w3.org/1999/xlink"
      > xmlns="http://www.w3.org/2000/svg">
      > <defs>
      > <!--Symbols for checkboxes-->
      > <symbol overflow="visible" preserveAspectRatio="xMidYMid meet"
      > id="checkBoxRect">
      > <rect x="0" y="0" fill="white" width="100" height="100"
      > stroke="dimgrey" stroke-width="15"/>
      > </symbol>
      > <symbol fill="none" id="checkBoxCross"
      > preserveAspectRatio="xMidYMid meet" stroke="dimgrey" stroke-
      > width="10" pointer-events="none">
      > <line y2="100" x1="0" x2="100" y1="0"/>
      > <line y2="0" x1="0" x2="100" y1="100"/>
      > </symbol>
      > </defs>
      > <script type="text/ecmascript">
      > <![CDATA[
      > function init()
      > {
      > main = document.getElementById("main");
      > carto = document.getElementById("carte");
      > }
      >
      > function inverser()
      > {
      > alert("flag1");
      > for (i=0 ; i<2; i++)
      > {
      > symbole = document.getElementById("symb" + i);
      > fill = symbole.getAttribute("fill");
      > fill = fill.substring(4,fill.length - 1);
      > color = fill.split(",");
      > ancienR = color[0];
      > ancienV = color[1];
      > ancienB = color[2];
      > nouveauR = ancienV;
      > nouveauV = ancienR;
      > nouveauB = ancienB;
      > nouvelleCouleur = "rgb(" + nouveauR + "," + nouveauV + "," + nouveauB
      > + ")";
      > symbole.setAttributeNS(null,"fill",nouvelleCouleur);
      > }
      > alert("flag2");
      > }
      >
      > function checkBoxScript(evt,myLayer) {
      > var myCheckCrossObj = document.getElementById("cc_"+myLayer);
      > var myCheckCrossVisibility = myCheckCrossObj.getAttributeNS
      > (null,"visibility");
      > if (evt.type == "click" && evt.detail == 1) {
      > if (myCheckCrossVisibility == "visible") {
      > myCheckCrossObj.setAttributeNS(null,"visibility","hidden");
      > }
      > else {
      > myCheckCrossObj.setAttributeNS(null,"visibility","visible");
      > }
      > inverser();
      > }
      > }
      > ]]>
      > </script>
      > <svg width="6000.0px" height="6000.0px" id="carte" viewBox="0 0
      > 6000.0 6000.0" preserveAspectRatio="xMidYMid meet"
      > xmlns="http://www.w3.org/2000/svg" zoomAndPan="magnify">
      > <g id="Fond et carte" >
      > <circle fill="rgb(255,0,0)" r="209.40681554472778"
      > id="symb0" cx="2762.6117036609976" cy="1515.4799654078988"/>
      > <circle fill="rgb(78,255,0)" r="173.20530240219819"
      > id="symb1" cx="3086.912654943788" cy="593.9463822427214"/>
      > </g>
      > </svg>
      > <g id="parametres">
      > <g id="inversion">
      > <a xlink:href="" xlink:type="simple" xlink:actuate="onRequest"
      > xlink:show="replace" xmlns:xlink="http://www.w3.org/1999/xlink">
      > <g transform="translate(6100 2040)">
      > <use onclick="checkBoxScript(evt,'inversion');"
      > xlink:type="simple" xlink:actuate="onRequest" id="cb_inversion"
      > xlink:show="replace" xlink:href="#checkBoxRect"
      > xmlns:xlink="http://www.w3.org/1999/xlink"/>
      > <use xlink:type="simple" visibility="hidden"
      > xlink:actuate="onRequest" id="cc_inversion" xlink:show="replace"
      > xlink:href="#checkBoxCross"
      > xmlns:xlink="http://www.w3.org/1999/xlink"/>
      > </g>
      > </a>
      > <text fill="black" x="6250" font-size="100" y="2120" pointer-
      > events="none" startOffset="0">inversion des couleurs</text>
      > </g>
      > </g>
      > </svg>
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.