Solved

Possible to reference CSS3 id as a control like a button

Posted on 2014-01-30
10
267 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
  • 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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 500 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS Header Navigation Not Responsive 4 31
JQuery Syntax... 4 38
Amazon S3 Images with .Net 3 15
JS Event Does not Trigger From File 2 29
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…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

820 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