Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SVG Elements - hover effect and z-index

Posted on 2013-06-23
3
Medium Priority
?
1,173 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
ID: 39269805
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
ID: 39269810
how do i move it with jquery?
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39269827
$('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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

885 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