标签: click

jQuery fadeIn fadeOut点击

当点击另一个div时,我试图制作一个div fadeIn,当点击另一个div时再次fadeOut(这将是关闭按钮)但是我的代码不起作用,我忘记了什么吗?

这是CSS:

body{
    margin: 0;
    padding: 0;
    text-align: center;
    background-color:#f0f2df;
}

#container{
    border: solid 1px #f0f2df;
    background-color:#f0f2df;
    text-align: left;
    margin: auto;
    width: 939px;
    height: 570px;
    top:41px;
    position:relative;
}
#contact_form{
    display: none;
    background-image:url(../images/bg.png);
    width: 703px;
    height: 379px;
    position:absolute;
    left:236px;
    bottom:34px;

}
.contact_close{
    display:none;
    background-image:url(../images/close.png);
    width:17px;
    height:17px;
    position:absolute;
    right:5px;
    top:135px;
}
Run Code Online (Sandbox Code Playgroud)

HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<title>test</title>
<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='js/click.js'></script>
</head> …
Run Code Online (Sandbox Code Playgroud)

javascript jquery click fadeout fadein

6
推荐指数
2
解决办法
4万
查看次数

如何在Flex 4中的Spark List控件中处理click事件

我有:列表组件.我想处理一个click事件以了解选择了哪个列表项.我在s:List中没有看到Click事件.任何解决方法?

谢谢.

events list click flex4

6
推荐指数
2
解决办法
1万
查看次数

Android系统.如何使用setClickable同时设置所有按钮可点击或不可点击?

屏幕显示四个按钮.按下按钮时,媒体播放器播放声音.我遇到的问题是同时为所有按钮实现setClickable.

单击一个按钮后,我希望所有按钮都不可点击,直到媒体播放器播放完与按钮单击相关的声音.然后我想将所有按钮设置回可点击状态.

代码运行正常,直到我启用setClickable代码 - 在我的代码示例中禁用了buttonOne的代码.测试电话锁定并告诉我应用程序已停止并再次尝试.

不幸的是,如果没有setClickable,用户可以在完成第一个选定声音播放之前按任意按钮并听到任何声音.

感谢您的时间和帮助.

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageButton;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;


public class hipsterdoofus  extends Activity
{
 private int asoundfilenumber;//integer id of sound file to be played

 public ImageButton buttonOne;
 public ImageButton buttonTwo;
 public ImageButton buttonThree;
 public ImageButton buttonFour;


 public void myClickHandler(View v) {



    switch (v.getId())
       {

        case R.id.buttonOne:
         asoundfilenumber=0x7f040000;
         break;

        case R.id.buttonTwo:
         asoundfilenumber=0x7f040001;
         break;

        case R.id.buttonThree:
         asoundfilenumber=0x7f040002;
         break;

        case R.id.buttonFour:
         asoundfilenumber=0x7f040003;
         break;   



        }//closes switch test



    freezeButtonsAndPlaySoundThenUnfreezeButtons();

  }//closes …
Run Code Online (Sandbox Code Playgroud)

android click button clickable

6
推荐指数
1
解决办法
1万
查看次数

jquery datepicker阻止onSelect中的本机单击

我正在努力阻止jquery datepicker.onSelect事件中的本机点击

以下示例无效,单击仍然被触发:

onSelect: function(dateText, inst) { 

if (myCondition) {
   return false; 
 }}
Run Code Online (Sandbox Code Playgroud)

如果事件对象可用,另一个技巧是调用onSelect中的event.preventDefault /.

任何已知的方案?

jquery events click datepicker onselect

6
推荐指数
1
解决办法
2863
查看次数

如何在鼠标悬停时设置"提交"输入的样式,单击?

我需要设置两个不同的输入样式,以便在鼠标悬停和点击时显示不同,就像按钮一样.通常我会用按钮; 但是,其中一个是输入类型="重置",我认为使用输入比编写表单重置脚本更简单.对于鼠标悬停和单击,一种样式如何输入"提交"和"重置"类型?

css input click mouseover reset

6
推荐指数
1
解决办法
4万
查看次数

在jquery中按钮单击事件的问题

我在按钮点击使用jQuery显示div但不知道为什么它不工作...

HTML:

<input type="button" id="addmoresg" value="Add More" name="button">
<div id="addsg" style="display:none">
    <!-- more HTML here -->
</div>
Run Code Online (Sandbox Code Playgroud)

JavaScript的:

$(document).ready(function() {
    $('.addmoresg').click(function() {
        $('.addsg').show("slow");
    });
});
Run Code Online (Sandbox Code Playgroud)

jsFiddle演示: http ://jsfiddle.net/XGVp3/

按钮点击我没有得到任何结果.

html jquery click button

6
推荐指数
1
解决办法
2万
查看次数

在jQuery Flot"plotclick"事件中获取单击的标签

所以我在jQuery中有一个方法来捕获我的Flot图表上的点击事件:

$("#placeholder").bind("plotclick", function (event, pos, item) {
    alert("clicked");
});
Run Code Online (Sandbox Code Playgroud)

我知道item ['datapoint']数组中的点击值.但是我在哪里可以找到我点击的曲线标签?

谢谢.

jquery events click flot

6
推荐指数
1
解决办法
8402
查看次数

如何在Android中测试AlertDialog?

我正试图测试AlertDialog一下ActivityInstrumentationTestCase2.

这是原始代码:

    this.setmBtAppelerFixe(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            AlertDialog.Builder dialog = new AlertDialog.Builder(InterventionImmobiliereDetailsActivity.this);
            dialog.setTitle("Appel");
            dialog.setMessage("Appeler le contact ?");
            dialog.setCancelable(true);
            dialog.setNegativeButton("Non", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                }
            });
            dialog.setPositiveButton("Oui", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    InterventionImmobiliereDetailsActivity.this.lancerIntentAppel(mIntervention.getTelContact());
                }
            });

            mAdAppelerFixe = dialog.create();
            mAdAppelerFixe.show();
        }
    });
Run Code Online (Sandbox Code Playgroud)

现在我无法点击正面按钮.此代码似乎不起作用:

    mActivity.runOnUiThread(new Runnable() {
        @Override
        public void run() {
            assertTrue(mLLAppelerFixe.performClick());

            AlertDialog mDialog = mActivity.getAdAppelerFixe();
            assertTrue(mDialog.isShowing());

            Button okButton = …
Run Code Online (Sandbox Code Playgroud)

android unit-testing click button android-alertdialog

6
推荐指数
1
解决办法
1万
查看次数

滚动鼠标悬停,点击查看速度

当你将鼠标悬停在div上时,我试图让我的页面滚动.这是我到目前为止所得到的

$(document).ready(function() {
    $("#hoverscroll").mouseover(function() {
        var div = $('body');
        setInterval(function(){
            var pos = div.scrollTop();
            div.scrollTop(pos + 1);
        }, 100)  
    });
});
Run Code Online (Sandbox Code Playgroud)

http://jsfiddle.net/3yJVF/

但是,还有两件事要做.我需要它在每次单击时提高速度,在不再悬停时停止并将速度重置为默认值.

我正在努力实现这样的目标:

$(document).ready(function() {
    $("#hoverscroll").mouseover(function() {
        var div = $('body');

        setInterval(function(){
            var count = 1;
            var pos = div.scrollTop();
            div.scrollTop(pos + count);
        }, 100)  
    });

    $("#hoverscroll").click(function() {
        if (count < 6) {
            count = count+1;
        }
    });

    $("#hoverscroll").mouseleave(function() {
        count = 0; 
    });
});
Run Code Online (Sandbox Code Playgroud)

我搜索并发现有些人在谈论绑定事件并设置一个全局变量来检查它是否在滚动.但上述功能会起作用吗?我仍在学习.我可能完全错了.

jquery events scroll click hover

6
推荐指数
1
解决办法
1万
查看次数

dom更改后.click()失败

我在网上搜索但我没有找到任何答案,因为这个"问题"不是关于.on()和.click()之间差异的常见问题.使用jquery 2.1.3时,click函数是一个简称,on.("click", handler)因此它应该在dom更改后触发函数(或wathever).但这只有在我使用.on()时才有效.为什么?(以下示例)

$('#button1').click(function() {
    $('div').html("<p id="button2">Hello</p>");
});

$('#button2').click(function() {
    alert(0); //THIS DOESN'T WORK
});

$(body).on("click", "#button2", function() {
    alert(0); //THIS WORKS!
});
Run Code Online (Sandbox Code Playgroud)

jquery dom click

6
推荐指数
2
解决办法
7370
查看次数