javascript - jQuery connect with lines -
how can connect numbers dotted lines in below jsfiddle.
i want these lines start border of inner circle, either jquery or css. mean around border of inner circle start inner border edge number , ....... 1, ..... 2 show guide lines.
http://jsfiddle.net/ineffablep/x03f61db/
function createfields() { $('.field').remove(); var container = $('#container'); for(var = 0; < +$('input:text').val()+1; i++) { $('<div/>', { 'class': 'field', 'text': }).appendto(container); } } function distributefields() { var fields = $('.field'), container = $('#container'), width = center.width()*2, height = center.height()*2, angle = 0, step = (2*math.pi) / fields.length; var radius = width/2; var containerlength=$('input:text').val(); angle=step* (containerlength-1); fields.each(function() { var x = math.round(width + radius * math.cos(angle)); var y = math.round(height + radius * math.sin(angle)); $(this).css({ right: x + 'px', top: y + 'px' }); angle -= step; }); } var center = $('#center'); $(window).resize(function(height) { $('#container').width($(window).height()*0.9) $('#container').height($(window).height()*0.9) var width = $('#container').width() * 0.4; console.log("width",$('#container').width()); console.log("height",$('#container').height()); var radius = width/2; width += 'px'; radius += 'px'; center.css({ width: width, height: width, '-moz-border-radius' : radius, '-webkit-border-radius' : radius, 'border-radius' : radius }); createfields(); distributefields(); // rest of code font-size setting etc.. }); $(window).resize(); $('input').change(function() { createfields(); distributefields(); });
i have achieved canvas
context.fillstyle = '#00867f'; context.fill(); context.linewidth = 1; context.strokestyle = '#f0ebf1'; context.stroke(); context.setlinedash([1,2]); context.moveto(lx, ly); context.lineto(nx, ny);
Comments
Post a Comment