Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

create an image by css

Tags:

css

I'm trying to do the next thing in css:

enter image description here

when the user over on all of the image with his mouse,

the css would be changed to:

enter image description here

in image number 2 and 3, I have to enable him to press the small circles. I enabled it.

enter image description here

I didn't succeed to start the blue line from the small circle (like in image 1):

this blue line can go to the left or to the right by a given input (100 will color all the right gray shape. -100 will color all the left gray shape. in this example, I assume the user inserts the parameter: 25. and then quarter of the right gray shape was colored)

can someone help me with that please?

the blue line is in the class PersonaCanvasMini and it exactly like PersonaCanvas

any help appreciated!

here's my jsfiddle:

http://jsfiddle.net/kyfha/74/

this is my html:

<div id="goalDetails" onmouseOver="addDetails();" onmouseout="removeDetails();">

    <div class="PersonaCanvas">
        <div class="smallCircle" onclick="showProjection();"></div>
        <div id="smallestCircle" style="display: none" onclick="showBurnRate();"></div>
    </div>

    <div id="details" style="display: none">
        <div id="dolarsDetails">77$</div>
        <div id="projOrBurn">Projection</div>
    </div>

    <div id="mainShape" class="bigCircle">
        <div id="cpaDetails">7.03</div>
    </div>

    <div class="PersonaCanvasMini"></div>
    <div id="mainLine" style="display:none"></div>
    <div id="secondaryLine" style="display:none"></div>
</div>

and my css is in the jsfiddle.

like image 217
Alon Shmiel Avatar asked Dec 11 '13 21:12

Alon Shmiel


People also ask

How do I get an image in CSS?

Usage is simple — you insert the path to the image you want to include in your page inside the brackets of url() , for example: background-image: url('images/my-image. png'); Note about formatting: The quotes around the URL can be either single or double quotes, and they are optional.

Can you style an image in CSS?

Using CSS to style images allows you to uniformly specify how images should appear across your website with only a few rulesets.

How do you create a custom image in HTML?

To insert an image in HTML, use the image tag and include a source and alt attribute. Like any other HTML element, you'll add images to the body section of your HTML file. The HTML image element is an “empty element,” meaning it does not have a closing tag.


1 Answers

Alon, what you are trying to achieve can be done either with jQuery + CSS OR it might be better to try using Kineticjs javascript library for working with HTML canvas. If you need to bind real time data to your graphic then you should probably use Angularjs in conjunction with Kineticjs OR with jQuery (if you can't avoid it).

Note.. Kineticjs is very easy to learn and use and I would suggest you start with that: http://www.html5canvastutorials.com/kineticjs/html5-canvas-events-tutorials-introduction-with-kineticjs/

like image 95
GRowing Avatar answered Oct 06 '22 00:10

GRowing