onclick

layer简单使用

自作多情 提交于 2019-12-22 01:38:04
官方: https://www.layui.com/doc/modules/layer.html 源码: https://github.com/xiaostudy/web_sample 效果 目录结构 代码 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta charset="UTF-8"> 5 <title>Title</title> 6 <script src="../js/jquery-3.3.1.js"></script> 7 <script src="../js/layer/layer.js"></script> 8 9 <script type="text/javascript"> 10 function msg1() { 11 layer.msg("msg弹窗,默认停留3秒"); 12 } 13 14 function msg2() { 15 layer.msg("msg弹窗,停留2秒", {time: 2000}); 16 } 17 18 function msg3() { 19 layer.msg("msg弹窗,不关闭", {time: -1}); 20 } 21 22 function msg4() { 23 layer.msg("msg弹窗,图标", {icon: 6, time: 2000});/

Javascript onclick needs to be clicked twice for function to run

女生的网名这么多〃 提交于 2019-12-22 01:09:37
问题 Javascript onclick needs to be clicked twice for function to run. I need it to run on the first click, That is my problem. I've googled and searched for 2 days now without finding a reply that worked or that I understood. The code for the javascript can be found here: http://enji.se/windows8/js/script.js And the site where I want it to work: http://enji.se/windows8/ It's a Windows 8 looking website I'm trying to make. It will only display correctly on Google Chrome and on a resolution higher

Android ListView items not responding when come back from another activity?

北城余情 提交于 2019-12-21 23:29:21
问题 I create a ListView from an ArrayAdapter. Each row of ListView have an ImageView and a TextView. Now I handle clicked event by using setOnItemClickListener lv = getListView(); lv.setOnItemClickListener(new OnItemClickListener() { public void onItemClick(AdapterView<?> parent, View view, int position, long id) { CategoryInfo cat = (CategoryInfo) lv .getItemAtPosition(position); showGameByCategory(Long.valueOf(cat.getId()), cat.getName()); } }); When I click on a row, it will start another

jQuery rotate div onclick +/-90

耗尽温柔 提交于 2019-12-21 22:44:45
问题 I was wondering if there is an easy way to rotate a div +90 degrees after clicking it and by clicking it next time it returns to 0 degrees (so that the div rotates -90 degrees). Since I couldn't find anything I was looking for your help. Thanks. 回答1: You could use toggleClass and apply css transform to that class: $('#rotate').click(function(){ $(this).toggleClass('rotated'); }); fiddle .rotated { -webkit-transform: rotate(90deg); -moz-transform: rotate(90deg); -o-transform: rotate(90deg);

Dijit TabContainer Events - onFocus

旧城冷巷雨未停 提交于 2019-12-21 20:37:26
问题 I have a Tab Container and I want to execute some js when I click on a tab's title bar. I can't seem to figure out how to add an event to that. EDIT: It looks like I'll be using onFocus, but I'm still having trouble finding the proper syntax. EDIT: Found onFocus and onBlur, but still having trouble getting it to work. 回答1: You need to connect to the _transition event. var tabs = dijit.byId("tabs"); dojo.connect(tabs,"_transition", function(newPage, oldPage){ console.log("I was showing: ",

Make an entire <li> element clickable, but don't trigger the link when clicking inside links

微笑、不失礼 提交于 2019-12-21 17:37:33
问题 I've been looking for a solution the last few days, I didn't really found exactly what I'm looking for. I have something like this: <ul> <li> <a href="http://www.link.com" class="li-url"></a> <h1>Title</h1> Lorem ipsum dolor <a href="http://www.something.com">Something</a>. Etc, blah blah. </li> </ul> What I need: Click on the LI element: Go to www.link.com Click on "Something" inside the LI: Go to www.something.com (And DON'T go to www.link.com) (And I don't know if it's possible, but it

Javascript fires two events - onkeypress and onclick

自古美人都是妖i 提交于 2019-12-21 15:18:12
问题 Problem is when I press a key over a radio button, element MyFunc fires twice - once for "onkeypress" event, another time for "click" event. Question "Why?" I need to handle this by two different ways, but now I can not recognize what initial event was. When I click a mouse it fires just for "click" event. <ul> <li> <input type="radio" onkeypress="MyFunc(event, this)" onclick="MyFunc(event, this)" name="myList" id="MyId_1" />Topic 1 <input type="radio" onkeypress="MyFunc(event, this)" onclick

安卓常用属性三

筅森魡賤 提交于 2019-12-21 08:50:52
day 10 简单对话框 String[] str = new String[]{"大数据", "物联网", "云计算", "无人机", "机器人", "人工智能", "5G", "3D打印", "区块链"}; String str1 = "云计算"; //定义AlertDialog.Builder AlertDialog.Builder builder = new AlertDialog.Builder(MainActivity.this); //设置标题 builder.setTitle("简单消息对话框"); //设置显示内容 builder.setMessage("大家好,这里是江洲老师云课堂!"); //设置按钮,以及按钮对应的监听事件 builder.setPositiveButton("确定", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { Toast.makeText(MainActivity.this, "您单击了【确定】", Toast.LENGTH_SHORT).show(); } }); builder.setNegativeButton("取消", new

On-Click img border = #color - Multiple images - Only need 1 highlighted at a time

被刻印的时光 ゝ 提交于 2019-12-21 06:17:32
问题 Basically what I am trying to accomplish is create a list of images (let's say 10) and upon clicking any of these images, their border changes to a specific color; currently accomplishing this with a simple onClick event with JS. That's not an issue. The trouble comes in when clicking a second or third or forth image; all of the images clicked remain highlighted, of course. I would like to set it so that only the last (current) image selected in the set remain with the border color changed.

Need to access data in JSON.stringify object

二次信任 提交于 2019-12-21 05:11:21
问题 The background for this question is I'm trying to access the selected cell from addListener in google visualization calendar. I could print the selected cell using JSON.stringify(chart.getSelection()); . It prints as [{"date":1468195200000,"row":0}] . My problem is to access this date object. I tried to access it as var obj=JSON.stringify(chart.getSelection()); console.log('selected value '+obj.date); But it displays as Undefined . When I print the obj it displays as [object, object] If you