onclick

Differentiate Single click and double click of a imageView in android

笑着哭i 提交于 2019-12-02 14:16:12
I have tried the following code to differentiate single click and double click. Single click is ok. When I double click the imageview, code inside both the single click and double click part execute. private static final long DOUBLE_PRESS_INTERVAL = 250; // in millis private long lastPressTime; boolean mHasDoubleClicked; img_feat_orgn_item.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub findDoubleClick(); } }); private boolean findDoubleClick() { // Get current time in nano seconds. long pressTime = System.currentTimeMillis(

Add disabled attribute to input element using Javascript

对着背影说爱祢 提交于 2019-12-02 14:15:53
I have an input box and I want it to be disabled and at the same time hide it to avoid problems when porting my form. So far I have the following code to hide my input: $(".shownextrow").click(function() { $(this).closest("tr").next().show().find('.longboxsmall').hide(); }); This is the input that gets hidden as a result: <input class="longboxsmall" type="text" /> How can I also add the disabled attribute to the input? Incognito $("input").attr("disabled", true); as of... I don't know any more. It's December 2013 and I really have no idea what to tell you. First it was always .attr() , then it

Modal pop up fade in on open click and fade out on close

我的梦境 提交于 2019-12-02 13:58:02
问题 I have a rather simple question for once. I have delete buttons that open modal pop ups to confirm or deny deletion. I would like these modal pop ups to fade in on click and fade out on cancel. I've tried a few different things already, no luck so far. I just need a simple solution. Thanks in advance. Here's my code <style> div.delModal { position:absolute; border:solid 1px black; padding:8px; background-color:white; width:160px; text-align:right } </style> <script> function showModal(id) {

Inspect an element to investigate jQuery event bindings

Deadly 提交于 2019-12-02 13:56:47
Hypothetical: I find a page with a button ('#bigButton'), that when clicked causes a llama ('img#theLlama') to show() using jQuery. So, somewhere (say, Line 76) in buttons.js: $('#bigButton').click(function(){ $('img#theLlama').show(); }) Now, let's say I have a big HTML page with a whole bunch of .js files included. I can click on the button and see the llama appear, but I have no idea where the code above is. The solution I am looking for is very similar to that which is available with CSS in Firebug. I want to inspect the element and have it show me that this jQuery occurs in Line 76 of

Javascript change div content upon a click

和自甴很熟 提交于 2019-12-02 13:53:30
问题 I'm pulling a content from PHP array and I have a situation like this: <div class="weight-display"> <span>04/25/2011</span> <span>100lbs</span> <span>Edit</span> <a href="http://foo.com">Delete</span> </div> <div class="weight-display"> <span>04/27/2011</span> <span>150lbs</span> <span>Edit</span> <a href="http://foo.com">Delete</span> </div> etc... Now when somebody clicks on Edit within, let's say, first div where weight is 100lbs, I just need that "div" to change and to have input field

vertical navigation that shows hidden submenu on click using JQuery

社会主义新天地 提交于 2019-12-02 13:24:51
问题 I am trying to make a menu that works like the one on this flash site: http://elevensix.de/ When I click "portfolio", only then to the subnavigation links reveal themselves. Right now I have only managed to get a typical vertical "reveal subnavigation on hover menu" working. What is required is that once the appropriate menu item it cicked, its submenu shows. This submenu remains revealed as the submenu items are hovered over then selected. When the submenu item is selected, the content shows

How to toggle background image on button click?

╄→尐↘猪︶ㄣ 提交于 2019-12-02 13:20:37
I have this code: button1.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub button1.setBackgroundResource(R.drawable.detailpressed); Chapter_sync.add(chapid); } What I am trying to do is toggle all the methods called in the following clicklistener. Eg first time when I Click this button the setBackgroundResource(R.drawable.detailpressed) is called and on the next click same metod is called with different drawable. Something like toggle button. Someone good at this plz help? you can take a variable int i=0; it will increase

Java scripts not working in html email template

不羁岁月 提交于 2019-12-02 13:19:57
I have a scenario where I need to send an email using c#, which could be easily done using SMTP, but the challenge is to incorporate web service in the html mail, hence i have used java scripts inside mail body to access the web service when a button click is raised. As a html(Web Page), it works perfectly good but then when i send a mail and try with the click of a button in my mail, the onclick not raised the jscript and hence no action has happened and it was actually disabled . I checked with the firebug(in firefox) in the particular html tag, to my surprise the jscript tag was not present

Android - How to open Activity by clicking button [closed]

ぐ巨炮叔叔 提交于 2019-12-02 13:09:56
How do I open an Activity(GameProcess) by clicking on a button(ButStart)? I already edited it and take to manifest. What mistakes do you see? It crashes when I tap the button(ButStart). package com.makeandroid.klikomania; public class KlikomaniaActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button Butstart = (Button)findViewById(R.id.butstart); final Button Butrez = (Button)findViewById(R.id.butrez); Butstart.setOnClickListener(new View.OnClickListener() { public void onClick

Running Total C#

放肆的年华 提交于 2019-12-02 13:02:30
I'm creating a donation application that reads the input in a textbox, converts it to a double. Then using the method operatingCost , it should take that converted double and divide it by 17% (operating fees). Currently in the method, I have the variable dontationBFees coming in and then being divided by 17 and creating a new variable afterFees . Everything is working fine but I need to create a running total that will save all of the donations. It should display the total amount raised for the charity (that is, the total amount donated less all operating costs) for all donations up to that