on/off

jqurey事件的绑定

有些话、适合烂在心里 提交于 2020-01-31 15:10:36
jq 历史中绑定事件的三种方式: 1. on/off 2. bind/unbind 3. live/delegete 在JQuery 1.7之后 推出了 .on() 和 .0ff()方法 废弃了live() 和 delegete()方法 on/off 整合了 bind/unbind 方法 所以我们使用较多的绑定方法为 on/off 之前使用事件绑定 $ ( ".btn" ) . click ( function ( ) { console . log ( "啊~~~" ) ; } ) ; .on 参数 1 事件类型 (必填) 可以同时绑定多个事件,但限于事件功能相同时 事件功能不相同时,可以采用链式编程,在该方法的后面续写 参数 2 具体执行功能的 子元素! (可选) 参数 3 传递到函数内部的数据(有些类似实参) (可选) 参数 4 具体功能 (必填) $ ( ".box" ) . on ( "click mouseout" , ".min_box" , { sum : 20 } , function ( e ) { console . log ( "天气不错" ) ; //通过参数3 传递进来的参数 我们通过 event.data 来获取 console . log ( e . data . sum ) ; } ) ; 通过on绑定事件和直接通过事件名绑定 的区别: 1.

nginx图片处理相关

让人想犯罪 __ 提交于 2019-12-31 01:17:58
nginx本身有支持图片处理的模块,通过外部插件也可以实现此功能。 libgd的安装 前提是要有libgd的库文件, (1)去官网访问主页没问题, 下载文件还是翻墙下的,为了方便大家提供一个链接: http://files.cnblogs.com/files/bugutian/libgd-2.1.1.tar 使用起来就是解压: tar -vxf libgd-2.1.1.tar cd libgd-2.1.1 ./configure make make install 就行了。如果启动nginx的时候还报找不到动态库,那就自己find一下,然后 export LD_LIBRARY_PATH=/Path/to/libgd.so:$LD_LIBRARY_PATH 在启动,或者把路径写到系统的环境变量也行。 (2)当然也还有更简单的方法,直接yum安装也行,自己配置好yum源,然后: yum install gd-devel pcre-devel libcurl-devel 因为libcurl也是需要的一部分,所以一起安装。 相对的编译也会简单,可以不用下面那么麻烦。 ./configure --prefix=/usr/local/nginx --with-pcre --add-module=../ngx_image_thumb-master make make install

ubuntu下nginx配置图片缩放ngx_image_thumb——转

心不动则不痛 提交于 2019-12-13 14:24:21
ngx_image_thumb是nginx中用来生成缩略图的模块,生存缩略图的方法很多,之前也写过一篇 《 nginx生成缩略图配置 》,在github上发现国人开发的一款模块,作者的文档写的很详细,我便照搬过来了。以后将做一个测试. 特性 本nginx模块主要功能是对请求的图片进行缩略/水印处理,支持文字水印和图片水印。支持自定义字体,文字大小,水印透明度,水印位置,判断原图是否是否大于指定尺寸才处理等等 1. 编译方法 编译前请确认您的系统已经安装了libcurl-dev libgd2-dev libpcre-dev 依赖库 1.1 Debian / Ubuntu 系统举例 # 如果你没有安装GCC相关环境才需要执行 $ sudo apt-get install build-essential m4 autoconf automake make $ sudo apt-get install libgd2-noxpm-dev libcurl4-openssl-dev libpcre3-dev 1.2 CentOS /RedHat / Fedora # 请确保已经安装了gcc automake autoconf m4 $ sudo yum install gd-devel pcre-devel libcurl-devel 1.3 FreeBSD / NetBSD / OpenBSD

Nginx学习笔记--Nginx图片缩略图,水印处理模块

我只是一个虾纸丫 提交于 2019-12-10 08:49:02
本nginx模块主要功能是对请求的图片进行缩略/水印处理,支持文字水印和图片水印。 1.环境准备 确认已经安装了libgd2-devel,libpcre-devel,libcurl-devel模块 2.下载nginx的tar.gz文件,并通过tar -zxvf 进行解压缩 3.下载模块源代码(https://github.com/3078825/nginx-image/archive/master.zip ),保存到nginx的源文件目录下(如/usr/local/src/nginx1.2.6)。模块的源代码文件为ngx_image_thumb-master.zip。通过 unzip ngx_image_thumb-master.zip 对模块源码进行解压缩 4.配置nginx的参数 添加图片处理模块 ./configure --add-module=ngx_image_thumb-master 5.make & makeinstall 编译安装nginx 6.通过nginx.conf文件 配置图片处理模块 location / { root html; index index.html index.htm; image on; image_output on; image_water on; image_water_type 0; image_water_file "/usr

Twilio client voice call speaker ON/OFF issue

佐手、 提交于 2019-12-06 06:53:48
I am using Twilio client voice call service for calling. Here I am facing issue in spearke ON/OFF feature.I am able to Mute/Unmute call but not able to turn On/OFF speaker. I have a same instance for both functionality. I have also checked their demo project basic phone in that this speaker ON/OFF is working and I am doing same thing in my project bur not able to do the same. Here is my code: if(isSpeaker == NO) { isSpeaker=YES; [self.phone setSpeakerEnabled:YES]; } else{ isSpeaker=NO; [self.phone setSpeakerEnabled:NO]; } > 来源: https://stackoverflow.com/questions/37893672/twilio-client-voice

Turning on/off flash with Android camera2 API not working

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm creating an Android app with a custom camera and I'm switching to the new camera2 API. I have a button allowing to turn ON and OFF the flash when the back camera is on (without stopping the camera, like any classic camera app). When I tap the flash icon, nothing happens and this is what the logcat returns: D/ViewRootImpl: ViewPostImeInputStage processPointer 0 D/ViewRootImpl: ViewPostImeInputStage processPointer 1 I don't know why it's not working. Here is the code: I have a RecordVideoActivity using a RecordVideoFragment . Here is the

How to turn on/off ReactJS 'development mode'?

匿名 (未验证) 提交于 2019-12-03 02:45:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Started using ReactJS's prop validation feature , which as the docs say only works in 'development mode' for performance reasons. React seems to be validating the properties of a particular component I've annotated, but I don't remember explicitly turning on 'development mode'. I tried searching for how to trigger/toggle development mode, but haven't had any luck. 回答1: The other answer assumes you are using external pre-built files from react, and while correct that is not how most folks are going to or should consume React as a

UISwitch set on/off Image

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to set my Switch like this: But I try in ios9 , it does not work. I saw in apple UISwitch Class Reference. It says that : Discussion In iOS 7, this property has no effect. How about iOS 9? Any one success? My Code: switch1 = UISwitch(frame:CGRectMake(self.view.frame.width/2 - 20, 400, 10, 100)) switch1.on = true switch1.onTintColor = UIColor.lightGrayColor() switch1.tintColor = UIColor.greenColor() switch1.thumbTintColor = UIColor.blackColor() //set on/off image switch1.onImage = UIImage(named: "on-switch") switch1.offImage = UIImage

Controlling a USB power supply (on/off) with linux

匿名 (未验证) 提交于 2019-12-03 01:57:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is it possible to turn on/off power supplies from USB manually with linux? There's this external USB cooling fan (the kind you use to cool yourself off, not the PC), and it would be nice to be able to control it from the terminal, because I want to position the fan somewhere far away. I suppose this could also be useful for a variety of other things as well, because there's a lot of USB toys out there. Maybe air purifiers etc (I heard they don't really work though). 回答1: Note. The information in this answer is relevant for the older kernels

How to Turn on/off debug mode using adb command in android

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I don't know it is possible or not to turn ON/OFF android debug mode using adb command. Is there really any adb command exist to turn ON/OFF android debug mode. Please if any suggest or any kinds of way around will be highly appreciated. 回答1: You can turn off USB Debugging with settings put global adb_enabled 0 command. 回答2: I don't know it is possible or not to turn ON/OFF android debug mode using adb command. By definition, this is not possible, as adb commands only work when debug mode is on. 文章来源: How to Turn on/off debug mode using adb