click

window.onbeforeunload in javascript

感情迁移 提交于 2019-12-11 02:03:57
问题 I'm using javascript window.onbeforeunload function to show an alert to user whenever user tries to leave the page without submitting the data. This functinality is working fine. Problems comes in IE (only) where the window.onbeforeunload event fires even on click of internal links like <a class="editlink" onclick="fnEditLink(this);" href="javascript:void(0);" > <img src="/images/newstyle/pencil.png" alt="edit" /> Edit </a> This is an internal link that is used to edit grid row without making

d3: brush changes click to mouseover

拟墨画扇 提交于 2019-12-11 01:18:52
问题 I'm trying to create a scatter plot with a combination of brush selection, tooltips and click events, but it seems that once I add a brush to an svg canvas, all click events on objects get mapped to mouseovers. Is there any way around this? Example code below and @ http://jsfiddle.net/7j8cr/ <script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> <script> var my_circles = [{"x": 40, "y": 100, "r": 12}, {"x": 100, "y": 40, "r": 8}], width = 400, height = 400, svg = d3.select("body

jQuery — click function on a class added via 'addClass' does not respond

安稳与你 提交于 2019-12-11 01:03:33
问题 I've added a class via addClass. I have an onclick function for that added class. However jQuery ignores the click function I created for that class. I've tested it on JSFIDDLE here <style type="text/css"> .openInfo:hover{color:red} .closeInfo:hover{color:blue} </style> <div class="openInfo">OPEN</div> <script> $('.openInfo') //executes correctly .click(function() { $(this).text("CLOSE"); $(this).addClass('closeInfo'); $(this).removeClass('openInfo'); }); $('.closeInfo') //ignored .click

How do i disable a text box within an iframe

依然范特西╮ 提交于 2019-12-11 00:56:43
问题 The scenario: One big bulky page called index.html, everything happens here. Index has 10 tabs (jquery ui tabs). Using jquery ui's accordion widget, each tab now has, on average, 3-5 sub categories (I was denied posting a picture as spam prevention but I hope you understand what the layout looks like). Here's where the problem starts. An iframe resides in all of these, so I'm looking at 25-30 iframes with about 5-10 text fields in each iframe. What I want to do is just simply enable/disable

Dynamically generated Controls ID returned as NULL

喜夏-厌秋 提交于 2019-12-11 00:28:53
问题 I am able to create dynamic controls in Page_PreInit() function. 'How to retrieve the control and its ID' My C# code to create one of the DynamicControls var btn = new WebForms.Button(); btn.Text = "+"; btn.ID = "Addmore"; btn.Click += new System.EventHandler(AddMoreSearchFields); I am using the below piece of code to find which controlid is clicked. string eTarget = Request.Params["__EVENTTARGET"].ToString(); **eTarget is always "" NULL** protected void Page_PreInit(object sender, EventArgs

Switch color of button on click (and revert color of other buttons)

跟風遠走 提交于 2019-12-10 23:36:06
问题 I have three buttons, and want to change the color of the button on being selected. As you will see, I am able to change the color on selection, but I need buttonA to return to its original color when buttonB is selected (at which point buttonB should take on the selected color) and so on. Currently each button selected takes on the selected color, but buttons do not return to their original color. Please see this fiddle: http://jsfiddle.net/Fwqv8/ This is the script: jQuery(document).ready

How can I prevent a double submit($.post) with jQuery

偶尔善良 提交于 2019-12-10 23:30:53
问题 $(document).ready(function(){ $("#enviar").click(function(e){ e.preventDefault(); //prevent run 2 or more times if the user clicks the button multiple times to send $.post(url,{data:data1,data2:data2},function(rp){ }); }); }); as prevent send 2 times the "post" if the user repeatedly click the button, without disabling the submit button 回答1: Use a special class (e.g : submitting ) as a marker to indicate the request is in progress : $("#enviar").click(function(e){ e.preventDefault(); var btn

Why does an ASP.NET DropDownList control requires two clicks to expand in Internet Explorer

江枫思渺然 提交于 2019-12-10 22:54:25
问题 I have an ASP.NET DropDownList control that renders into a dropdown list (select HTML tag) on a page. For some reason, when I'm in Internet Explorer, it requires two clicks for me to open it up and see the options, which is just an extra click for the end-user. It works fine in Google Chrome, Mozilla Firefox and Safari--I only have to click once to see the options for a selection. Why would it not work correctly in IE? And more importantly, how can I fix it in IE? Here is my code: <asp

X/Y Coordinates of Click on an Image in a Windows Forms Application (.net)

我的梦境 提交于 2019-12-10 21:06:57
问题 Is there a way to tell what x/y coordinates were clicked in a FORMS application? 回答1: Take a look at the MouseEventArgs class. Specifically the GetPosition method. The example on MSDN is using onMouseMove, but you should be able to do the same with onMouseClick. Or just use the MouseClick event of the form. E.g. using the MouseClick event: On your form: this.MouseClick += new MouseEventHandler(myForm_MouseClick); void myForm_MouseClick(object sender, MouseEventArgs e) { int myX = e.X; int myY

img thumbnail click replace div text value with thumbnail title

大憨熊 提交于 2019-12-10 19:18:21
问题 JSFIDDLE HERE If you look at the js fiddle you will find clicking the thumbail changes the image aswell as the .currentimgtitle text value but it changes all .currentimgtitle text values on the page when i only want to change the one relevant to it the jquery and html are below $(".imgcontainer").each(function() { var imgsrc = $(".minicontainer img:first-child", this).attr("src"); var imgtitle = $(".minicontainer img:first-child", this).attr("title"); $(this).append('<div class="presentouter"