onmousedown

D3.JS - Rotate a pie chart on mouse down event

有些话、适合烂在心里 提交于 2019-12-02 14:35:18
I am looking for an example for to rotate a pie chart on mouse down event. On mouse down, I need to rotate the pie chart either clock wise or anti clock wise direction. If there is any example how to do this in D3.js, that will help me a lot. I found an example using FusionChart and I want to achieve the same using D3.js Pretty easy with d3: var svg = d3.select("body").append("svg") .attr("width", width) .attr("height", height) .append("g") .attr("transform", "translate(" + width / 2 + "," + height / 2 + ")"); var g = svg.selectAll(".arc") .data(pie(data)) .enter().append("g") .attr("class",

ActionScript 2 Moving an object

社会主义新天地 提交于 2019-12-02 12:40:38
I have very little knowledge of ActionScript. I have a movie clip. I want it to move along the x-axis when i press down on a button(button or movie clip) I do not know what code to use as it needs to be Action Script 2. Is there a Tutorial or something that can accomplish this? I have found a tutorial that moves the object around when you press a button. I am trying to get the same effect when you click down on a button: http://www.kirupa.com/developer/actionscript/xymove.htm Thank you for any help UPDATE The button is called btn and the object that moves is mctransparent I have managed the

Make Object Follow Mouse On MouseDown and “Stick” On MouseUp

这一生的挚爱 提交于 2019-12-02 01:27:14
I'm working with a project that is WPF and VB.net. I want to visually simulate "dragging" an object (though I do not want to use standard drag and drop for reason of purpose). Basically, I have a label object that, on its MouseDown event, I want it to follow the mouse cursor inside a 640x480 solid-size grid (but not outside of it!). Mind you, this grid is centered inside a full-screen window. Again, the object should not follow the mouse outside of the grid (I'm guessing a "ClipToBounds = True" here) Then, on the label's MouseUp event, I want it to either stay in its current position or return

How do I get the mouse coordinates using mousedown in d3?

社会主义新天地 提交于 2019-12-01 14:28:55
I am trying to create a graph in D3 where you can draw a square to zoom in. Right now, I am trying to get the mousedown function to work. I need to be able to click anywhere in the graph and get the coordinates. This is what I have now: svg.on("mousedown", mousedown) function mousedown() { console.log(event.clientX); } I know this is not correct, but I can't seem to find how I can access the mouse's coordinates. firstly, you need to set up the click event properly. svg.on('mousedown', function() { console.log(d3.event); } ); in your case: svg.on('mousedown', mousedown); function mousedown() {

How do I get the mouse coordinates using mousedown in d3?

不想你离开。 提交于 2019-12-01 12:29:58
问题 I am trying to create a graph in D3 where you can draw a square to zoom in. Right now, I am trying to get the mousedown function to work. I need to be able to click anywhere in the graph and get the coordinates. This is what I have now: svg.on("mousedown", mousedown) function mousedown() { console.log(event.clientX); } I know this is not correct, but I can't seem to find how I can access the mouse's coordinates. 回答1: firstly, you need to set up the click event properly. svg.on('mousedown',

Detect if I'm clicking an element within an element

大城市里の小女人 提交于 2019-11-29 10:22:26
I have an element (let's say div with id "Test") with a set height and width. Randomly placed within this element are other (smaller) elements (let's say id's "inner1","inner2","inner3"), but there is also whitespace, space where no elements are. I would like to have a function that fires upon clicking the main element, but then detect wether i'm clicking whitespace, or if not, clicking an inner element and if so, return the id of the inner element. Oh and the inner elements are dynamically generated so i don't know the id's before hand, i do know they are either div's or spans... (just as

mouseover while mousedown

五迷三道 提交于 2019-11-28 07:40:04
I have a large table with with each cell being 25x25 and a div inside each one. Each div has the class of "node" and a background colour is applied to them all. I'm in the process of writing some jQuery code that will change the colour of each div when the mouse goes over it while the mouse button is down. I currently have it so it works when I mouse over, but I only want it working when the mouse button is down aswell. I have tried many different ways to get it to work but so far I have had no look, below is my current code. $(document).ready(function(){ $(".node").mouseover(function(){ $

How to impliment a onmousedown and onmouseup on a touch screen iphone

≯℡__Kan透↙ 提交于 2019-11-27 23:33:23
I've very new to HTML/Java but am learning... I want to develop a button on an iphone that runs a java script command when press and when it is released. I've done this find using onmousedown and onmouseup attributes, but this does not work the same. could someone please point me in the right direction as to how to do this same thing on the iphone? The equivalent for onmousedown on touchscreen devices is ontouchstart , and the equivalent of onmouseup is ontouchend . If you would also like to detect dragging, you could use ontouchmove which is fired every time you move your finger after

does mousedown /mouseup in jquery work for the ipad?

淺唱寂寞╮ 提交于 2019-11-27 17:59:34
I am using the current code: $('body').mousedown(function() { $('div#extras').fadeTo('fast', 1); }); $('body').mouseup(function() { $('div#extras').delay(2000).fadeTo(1500, 0); }); This works great in safari but when I upload it and check it out on the ipad it doesnt work? I found out how to do this for the ipad for those who are interested: Instead of the code I used in my question, you would use: $('body').bind( "touchstart", function(e){ $('div#extras').fadeTo('fast', 1); }); & $('body').bind( "touchend", function(e){ $('div#extras').delay(2000).fadeTo(1500, 0); }); scunliffe Not exactly.

Delphi - moving overlapping TShapes

∥☆過路亽.° 提交于 2019-11-27 02:06:28
I've needed own triangle shape so, I inherited my triangle class form TShape and override paint method. Everything works fine, but I need to move this shapes with mouse. I set the method for every shape handling onMouseDown event. Moving work also fine. But If two shapes overlaps (shapes are in fact rectangles with some transparent areas), that the top's shape transparent area is over another shape, then the top shape moves instead of the shape below. It's correct, that is how Delphi works. But it's not intuitive for the user. How can I achieve that? Is there possibility to not remove the