detection

How to detect if browser support specified css pseudo-class?

允我心安 提交于 2019-12-04 06:25:46
What's concept of detecting support of any css pseudo-class in browser through JavaScript? Exactly, I want to check if user's browser supports :checked pseudo-class or not, because I've made some CSS-popups with checkboxes and needs to do fallbacks for old browsers. ANSWER: I'm found already implemented method of testing css selectors in a Modernizr "Additional Tests" . You can simply check if your style with pseudo-class was applied. Something like this: http://jsfiddle.net/qPmT2/1/ stylesheet.insertRule(rule, index) method will throw error if the rule is invalid. so we can use it. var

Is it possible to detect if a plugin is activated or not through JavaScript?

一个人想着一个人 提交于 2019-12-04 04:33:08
问题 This way I would normally detect plugins, such as Flash Player: for (var el in navigator.plugins) { if (navigator.plugins[el].name && navigator.plugins[el].name.toLowerCase().indexOf('shockwave') !== -1) { console.log(navigator.plugins[el]); } } I'm not looking for a cross-browser solution or want to test if it is the right way or not. What is the way to test if this plugin is active or not? 回答1: Both of the other solutions work to find out if a plugin is installed AND is enabled. There is

How to detect the OS from a silverlight application?

白昼怎懂夜的黑 提交于 2019-12-04 04:13:26
I have a Silverlight3 application that is meant to run on both Windows and Mac OS environments. I would like to know in runtime if my application is running on a Windows or Mac so I can tweak a few things to the way users are accustomed to in their operating system of choice. For example, in Windows it is the norm to use "OK" "Cancel" buttons, while in Mac OS the norm is "Cancel" "OK" buttons (reverse order). Any ideas? NewAgeSolution There are two ways. From Silverlight: string os = Environment.OSVersion.Platform.ToString(); string version = Environment.OSVersion.Version.ToString(); From ASP

Is there any fast library(s) for finding human eyes and mouth in Flash? (Actionscript)

混江龙づ霸主 提交于 2019-12-04 04:05:26
So I have real time video stream. With 1 (one) person on It . It Is Black and White, I need to be able to capture this persons eyes and mouth (direction (at least X,Y), state (at least opened or closed) ) So Is there any fast library(s) for finding human eyes and mouth in Flash in such case? (pure Actionscript or Haxe\Java\C++\C port in SWC form...) What do I know Is - some libs are described in this presentation http://www.bytearray.org/?p=1040&cpage=1#comment-330183 Grate example for eyes is here http://play.blog2t.net/files/black-or-white/ Source for Face detection (AS3) http://www

How to detect movement of object on iPhone's camera screen?

强颜欢笑 提交于 2019-12-04 03:41:34
I have an application which needs to be able to detect the movement of object or image which is shown on camera screen. Is this possible with the iPhone? Bijoy Thangaraj You'll need to use a motion detection algorithm to do so. Check these links. They should help you get started. Fast, very lightweight algorithm for camera motion detection? How can you track motion using the iPhone's camera? 来源: https://stackoverflow.com/questions/12382780/how-to-detect-movement-of-object-on-iphones-camera-screen

How to detect if the script is running on a virtual machine?

别来无恙 提交于 2019-12-04 03:12:37
I don't think the question needs any explanation. I'm writing a software that can boot virtual machines to simulate a network. I would like to disable this feature if the software is already running on a virtual machine. I already read this post: How to detect if my application is running in a virtual machine? But I need to do it on Linux and that post covers only Windows. I'm tagging it as a Perl question as I've to do it in Perl, but probably there are some file in proc or somewhere else to check and it's the same for all languages. I don't know actually. I'm interested in detecting mainly

Detect if browser / device can play HTML5 video inline before playing

眉间皱痕 提交于 2019-12-04 02:35:01
I know I can check through navigator.userAgent if the device is an iPhone, but there are other devices and some I'm not aware of which will play the video in it's own player. There can be made a list of all browsers/devices which don't play a video inline, but I wonder if there is another solution. Is it possible in JavaScript to detect if a browser, for example Safari on iPhone, plays a video in it's own player instead of inline? So it can be possible to show an alternative, like an image, instead of the video. avaunt I know this is an old question, but it's a big issue for me and there isn't

jQuery: detecting cmd+click / control+click

一个人想着一个人 提交于 2019-12-04 00:04:56
i have the options of my web application in tabs. <ul id="tabs"> <li><a href="a.php">aaa</a></li> <li><a href="b.php">bbb</a></li> <li><a href="c.php">ccc</a></li> <li><a href="d.php">ddd</a></li> <li><a href="e.php">eee</a></li> </ul> When the user clicks on any tab (in the same window) there is a fadeout effect which i get with this code, and afterwards an automatic redirection: $('ul#tabs li a').click(function(e){ if(e.which == 1) { var link = $(this).attr('href'); $('#content').fadeOut('fast',function(){ window.location = link; }); } }); It works great, because it ignores the mouse middle

How to detect a returning visitor, and redirect to a specific URL? [closed]

社会主义新天地 提交于 2019-12-03 22:01:22
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center . Closed 6 years ago . I am developing a new website that needs the ability to detect if the user has visited the website previously, then direct them to a specific URL (i.e. example.com/welcomeback.html) if they have. I assume that this needs to be done with the usage of cookies and javascript, but I can't find any tutorials on this

Detecting a circle of a specific color (or gray level) with openCV

微笑、不失礼 提交于 2019-12-03 21:34:03
问题 Is there a way to detect a circle with a specific grey level using openCV? I want to detect a circle that marks out from the others. Currently, I'm using cvHoughCircles to detect my circles. I know the method returns an array of cvSeq containing the info on each circle (point and radius), but it does not provide any color information. Thank you 回答1: You should first isolate the colour you want, and then do a houghcircles on that image. Say you want to find green circles from a bunch of green,