Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2010
    Posts
    419
    Thanks
    18
    Thanked 2 Times in 2 Posts

    svg file rollovers/mouseovers

    I'm just starting to work with .svg files. Haven't done it before, and I'm running into a few glitches that I'm not sure what to do with.

    I want to put several items on top of a background, so they roll over, and a transparent svg file comes up to opacity:1, is clickable so I can bring content up.

    Right now, the onclick works, but when I added it, it removed the opacity mouseover issues. Also, when I try to condense the lines up, it kills the script and I'm not sure why. Right now, I notice that the :hover styling only works in safari, and not firefox, etc.

    Just curious if anyone can get me a little closer to correct looking script. here's what I have:

    Code:
    <?xml version="1.0"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
      "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
     
    
    
     
    <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
          width="120" height="120" viewBox="0 0 236 120">
          
          <style type="text/css" media="screen">
    	rect:hover {
    		cursor: hand;
    	}
    	</style>
               
          <g>
          	<rect x="1" y="1" style="cursor:hand;" width="60" height="130" fill="green" stroke="black" stroke-width="1" onmouseover="evt.target.setAttribute('opacity', '1');" onmouseout="evt.target.setAttribute('opacity','0)');" onclick="alert('click!');"	/>
          	<text x="14" y="75" font-family="Verdana" font-size="25" fill="white" 
          	onmouseover="evt.target.setAttribute('opacity', '1');"
    onmouseout="evt.target.setAttribute('opacity','0)');"
    onclick="alert('click!');"
    
          	> 01 </text>
          </g>
    </svg>

  2. Users who have thanked turpentyne for this post:

    tungpro1 (04-07-2013)

  • #2
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    i found some examples here: http://dev.opera.com/articles/view/i...-svg-and-xslt/
    maybe you'll wind something useful

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  • #3
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    1
    Thanked 0 Times in 0 Posts

    I was looking for it thanks

    I was looking for it thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •