Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Possible to reference CSS3 id as a control like a button

Posted on 2014-01-30
10
Medium Priority
?
281 Views
Last Modified: 2014-01-30
Please check this  JS Fiddle CSS Sample and advise if and the individual CSS classes elements could be referenced in HTML5 as controls.

using either C# / Javascript . JQuery etc
0
Comment
Question by:XGIS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39822764
What do you mean as controls
CSS is just plain text - it is not like a programming language.
0
 
LVL 7

Author Comment

by:XGIS
ID: 39822771
See how you can click it... use javascript to perform an action when the class item or div item is clicked... Maybe within MVVM or knockoutjs this is possible? like this  <div style="cursor: pointer;" onclick="theFunction()">
0
 
LVL 58

Expert Comment

by:Gary
ID: 39822782
Nothing to do with CSS
Are you using jQuery or just plain javascript?
0
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

 
LVL 7

Author Comment

by:XGIS
ID: 39822792
most likely jquery but custom javascript functions where required.  The css is good for referencing since there is so much addressable code such as the ids or classes?  The plan was to have two sector layers, with one underneath that goes beyond the extent of the one displayed
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39822800
Well you can start with this
http://jsfiddle.net/GaryC123/LMPcB/85/

And then do whatever you want in the click function.
0
 
LVL 7

Author Comment

by:XGIS
ID: 39822902
Thankyou Cathal..  I have one final query about this issue.  If I have the CSS layer so the "Top" sector Wheel overlays the "Bottom" Sector Wheel.  This assumes the "bottom" layer is physically under the "TOP" layer base on complexity of coding curved segments.  Is it possible to subtract CSS where overlap occurs.  Only the Outer segments of the "Bottom" sector should be active.  

eg in the image if the green actually underlays the blue, and the yellow underlays green and blue and the orange underlays all.  Any ideas on this? It does not need to be perfect, essentially it only needs to be a rectangle, unless curve subtraction is simpler nowadays?

CSS Sectors
0
 
LVL 58

Expert Comment

by:Gary
ID: 39822916
In this case you would probably better going for image mapping.
http://www.kolchose.org/simon/ajaximagemapcreator/

But since that image is nothing like your original question I don't know.
0
 
LVL 7

Author Closing Comment

by:XGIS
ID: 39822952
Hello Cathal ..Thankyou for your time.  The last link you sent is more relevant to another project I am doing, but I see what you mean. It may be useful if I can maintain coordinates relative to the html canvas in multiple browsers across multiple devices. Otherwise I will get the CSS developers to work harder to achieve this goal as per requirement.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39822976
If you have a static size you can use a transparent image absolutely positioned over your image above.  Map the coordinates and fire off whatever css/js as you mouseover/click.

Are these images you are using or are you drawing the concentric circles with canvas?
0
 
LVL 7

Author Comment

by:XGIS
ID: 39822986
Definitely Canvas at this stage.. no images planned for any component of this task.
I have seen calc() used in CSS 3 which may be useful as long as it does not significantly alter the shape on the outer ring, as it is based on degrees and angles.  Maybe that minor difference in shape would enhance visibility as a standalone "element/button control".
0

Featured Post

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

704 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