Jump to content
You must now use your email address to sign in [click for more info] ×

PauloAlmeida

New Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by PauloAlmeida

  1. Really too bad we don't have this option. I would like to write a plugin for that some day. FOR ANYONE TRYING TO ADD CLASSES/ATTRIBUTES TO A SVG LOADED ON A WEB BROWSER: I needed to add some attributes to a SVG that is loaded inside a HTML page. On my case, I had a Javascript array with all my elements. I solved my problem by adding a Javascript code that checks for the attributes I need and if its not present, adds it. On my case, I didn't need to add classes, but attributes: //get the element var map = document.getElementById(Bins[i].Map); if (map != undefined) { //check and add attribute if not found if (map.getAttribute("binid") == undefined) map.setAttribute("binid", Bins[i].Id); if (map.getAttribute("onmouseover") == undefined) map.setAttribute("onmouseover", "Hovered(this);"); if (map.getAttribute("onmouseout") == undefined) map.setAttribute("onmouseout", "UnHovered(this);"); if (map.getAttribute("onclick") == undefined) map.setAttribute("onclick", "Clicked(this);"); } in this case, I add the attributes I need to the element "map". I run this function every time the page loads. I think somebody could use the same type of code to add classes to those elements.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.