click

Determine on onclick whether the clicked link is meant to open a new window or tab

徘徊边缘 提交于 2019-12-12 10:42:28
问题 Most modern browsers support the commands ctrl+click or command+click or similar to open links in a new tab or a new window. In an application, I want the link to get disabled on clicking. But only, if the target is the same window (if it, for instance, opens in a new tab, I don't want the link to become disabled since it is reasonable to click it again). I did some tries and debugged the event object that gets created on click - but I cannot find any information about whether the target is a

Mouse click and drag Event WPF

馋奶兔 提交于 2019-12-12 09:33:21
问题 I am developing an analog clock picker control. The user is able to click on the minute or hour hand and drag to turn the needle to select the specific time. I was wondering how to detect such a click and drag event. I tried using MouseLeftButtonDown + MouseMove but I cannot get it to work as MouseMove is always trigger when the mousemove happen despite me using a flag. Is there any easier way? public bool dragAction = false; private void minuteHand_MouseLeftButtonDown(object sender,

.fadeTo not able to delay to fade

自古美人都是妖i 提交于 2019-12-12 06:15:28
问题 Trying to delay fade 500 to 1000, but when i change .fadeTo('500', 1); to .fadeTo('1000', 1); it's not delay to fade. Same timing, no difference between 500 to 1000. Jquery: $(".more-post").one("click", function () { $('.bottom-post').addClass('show-more').fadeTo('500', 0); setTimeout(function(){ $('.bottom-post').addClass('show-more').fadeTo('500', 1); },4000); }); This Jquery fade very fast, So how to fade delay more .fadeTo('1000', 1); . Want to fade more slow. Thanks. 回答1: When i removed

Spline chart, how to get the clicked item? [duplicate]

微笑、不失礼 提交于 2019-12-12 05:59:40
问题 This question already has answers here : get mark position in ms charts on mouse click (2 answers) Closed 3 years ago . I'm working whit charts on c#. I would like to know a way of get the iten (the spline) clicked on the chart to do something like change color or hide. 回答1: You can check the clicked item using HitTest , as suggested..: private void chart1_MouseDown(object sender, MouseEventArgs e) { HitTestResult result = chart1.HitTest(e.X, e.Y); // now do what you want with the data..: if

AS3 click event added to stage but fires when clicking on a movieclick

妖精的绣舞 提交于 2019-12-12 05:54:57
问题 i am a as3 newbie! I added a click event to the stage but this event also fires when i'm clicking a movieclip on the stage. How can i make this event fire only if i click directly on the stage? Thanks for any advice! 回答1: because of event bubbeling every click will also fire an stage click event. You can check in your function what the clicked target was by checking the currentTarget of the event. if(e.currentTarget == stage){ //do your stuff } 回答2: create layer at the bottom, add graphic

How to check if mouse is over a button in WPF? [duplicate]

余生颓废 提交于 2019-12-12 05:32:07
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Time Delay on Trigger I am using a few buttons in WPF for displaying images from various folders. The Click mode for all the buttons is Hover . For some button, after hovering, it is routed to a function OnButtonClick . What I want to do is, ONLY after the mouse is over the button for X seconds, the processing inside the function OnButtonClick should be done. EDIT: XAML Code: <Button Name="Dresses" Content=

Fade transparent .png's on top of each other on clicking link

◇◆丶佛笑我妖孽 提交于 2019-12-12 05:27:19
问题 I am creating a 650 X 610 px historical railway map and would like to start with a blank map, then fade in transparent .png layers containing just a fragment of the railway, one on top of the other, building up to an image of the whole network. There would be a list of the dates the network was extended to click and make that bit of line appear. Easily done using solid images, but very slow and there are 31 images. I couldn't find any forum queries about this anywhere. Please could anyone

Differentiate between user click and SetChecked() in CListCtrl

Deadly 提交于 2019-12-12 05:14:15
问题 I have a CListCtrl with checkboxes that I need to enable or disable based on some external factor. However, when I have more items in the list that can be displayed I cannot use EnableWindow(FALSE) on the control as it also disables the scrollbar. So, I have searched and came up with the following code in the message map: ON_NOTIFY(LVN_ITEMCHANGED, IDC_CHECKBOX_LIST, OnCheckboxChanged) The callback function is implemented as: void CUserPropertiesDialog::OnCheckboxChanged(NMHDR* pNMHDR,

Random images on click

柔情痞子 提交于 2019-12-12 04:47:49
问题 I have code on how to random images on refresh however i wan it to be like when i click a button a random images shows up how do i do that? Here's the code to random images: <? $imglist=''; //$img_folder is the variable that holds the path to the banner images. Mine is images/tutorials/ // see that you don't forget about the "/" at the end $img_folder = "images/tutorials/"; mt_srand((double)microtime()*1000); //use the directory class $imgs = dir($img_folder); //read all files from the

What can I get number of clicked element

不羁岁月 提交于 2019-12-12 04:32:42
问题 I have a few elements with identical class names. How can I get the number of the elements which I clicked with onclick events? For example: var x = document.getElementsByClassName("myclass").length; for (a=0; a<=x; a++) { // here i want get number of clicked myclass } 回答1: You can use indexOf on an array of document.getElementsByClassName("myclass") . You can use Array.from or [].slice.call to make the array. Assuming your click handlers look like in the snippet below and they “Do something