Solved

SVG Elements - hover effect and z-index

Posted on 2013-06-23
3
797 Views
Last Modified: 2013-06-24
Hi

Im trying to use SVG to create something similar to the attached graphic. Essentially they are a collection of categories symbolised by the circles. Each cartegory/circle has a lot of textual information associated with it that is shown when the circle is clicked.  This data is stored in a DB. Also there is a hover effect that shows a snippet of data(as seen on graphic)

I have created the following as a quick test:
https://www.app-cessories.co.uk/canvas/zoom/demo/paultest3.html

If you hover on top left circle it enlarges to depict the hover effect. How can i change the z-index of this? it currently sits below the adjacent circle and should be on top...

Also, do you think SVG is the best method to try and tackle this task? i did attempt html5 canvas but couldn't access each circle individually which i will need to do to be able to retrieve data from a database that is shown when each circle is clicked

Thanks
0
Comment
Question by:coolispaul
  • 2
3 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
You cannot with z-index.
You could with jquery change the element order - i.e. on hover move that circle to be the last element in the block - this is assuming you will be doing the same for the other circles...
...if not then just move it to the end.
0
 

Author Comment

by:coolispaul
Comment Utility
how do i move it with jquery?
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
$('body').on('mouseover', '#circle1', function () {
$hoverText.show();
$(this).appendTo("#svg_ID") // add an ID to the svg.
$(this).css('transform', 'translate(-100px,-50px) scale(2)');
}); 

Open in new window

0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now