草庐IT

IN_VISIBLE_GROUP

全部标签

javascript - 使用 jQuery 检查可见性时,$.data() 或 $.is (':visible' 哪个更快?

今天,当我为显示和隐藏菜单的两种方法编写一些代码时,我做了一个小测试,以了解检查菜单可见性的最有效方法。结果因浏览器而异,FF4.0b12使用$.data更快,但Chrome(webkit)和Opera使用$.is(':visible').我无法在IE9上测试,因为浏览器一直锁定我!这是测试用例:http://jsperf.com/data-or-display/3那么,使用jQuery检查可见性的最有效方法是什么? 最佳答案 $('whatever').is(':visible')读起来最好。我认为这才是最重要的。除非你需要每秒检

javascript - Jquery .validate require_from_group

每当我使用require_from_group时,它都会禁用所有其他验证。有什么想法吗?还有一种方法可以将“Telefon”和“Mobitel”分组并对其应用require_from_group吗?$(document).ready(function(){$("#fncMain").validate({/*groups:{Call:"TelefonMobitel"},*/rules:{Davcna:{required:true,exactlength:5,digits:true},Idzav:{required:true,exactlength:5,digits:true},Matic

javascript - Jasmine jQuery : Check if element is visible

你好,我有一个关于使用Jasmine(插件:jQuery)进行单元测试的问题我如何测试对象是否在文档的DOM中。问题是我使用了一个工具提示功能,只有在模拟事件时才会激活。当有模拟效果时,一个对象被附加到DOM上,我想检查它是否可见。it("test1:shouldinvoketheTooltip()function.",function(){spyEvent=spyOnEvent('.span_width',"mouseover");$('.span_width').simulate('mouseover');expect('mouseover').toHaveBeenTriggere

javascript - "[index : string]": IFoo notation in typescript

谁能告诉我这是什么[index:string]:IFoo表示在exportinterfaceIBar{[index:string]:IFoo;}exportinterfaceIFoo{CharacterName:string;DisplayName:string;}我翻阅了TypescriptRevealed一书,没有发现任何有关该符号的内容。它应该是实现IFoo的对象的集合吗?谢谢。 最佳答案 用于显示接口(interface)实例被索引时结果的类型。当IBar类型的元素被字符串索引时,即[someString]结果将是IFoo类

javascript - 类型错误 : 'undefined' is not a function with Tablesorter only in Safari

只有在safari中我才会收到错误:TypeError:undefinedisnotafunction(evaluating'$("table").tablesorter')在所有其他浏览器中它都有效。这是我的javascript代码,我在标题中放入了jquery脚本和tablesorterjavascript。那么我该如何解决这个问题呢?为什么它只在Safari而不是在任何其他浏览器中?$(function(){//callthetablesorterplugin$("table").tablesorter({theme:'jui',headerTemplate:'{content}

javascript - 文件结构 : Requiring Sub-Modules in Node. js

我有以下Node.js模块/npm包:|-dist/|--requirejs/|---[stuffinamdpattern...]|--node/|---index.js|---submodules/|----submodule1.js|----[submodule2.jsetc.]|-package.json|-README.md我可以通过模块名称要求dist/node/index.js(因为我将它设置为package.json中的主要入口点文件),如下所示:varmyModule=require('myModule');我想通过这样做来要求子模块(如在AMD模式中):varmySu

javascript - 未捕获( promise )SyntaxError : Unexpected token ' in fetch function

我有几个结构如下的JSON文件(我们称之为info.json):{'data':{'title':'Job','company':'Company','past':['fulltime':['FormerCompany'],'intern':['Women&IT','Priority5']],'hobbies':['playingguitar','singingkaraoke','playingMinecraft',]}}在一个单独的JavaScript文件中,我有一个如下所示的函数:functiongetJSONInfo(){fetch('info.json').then(funct

javascript - 初学者的 : const definition in Redux confusing

在这个Redux入门类(class)中https://egghead.io/lessons/javascript-redux-store-methods-getstate-dispatch-and-subscribe?series=getting-started-with-redux,主持人说下面两行是一样的const{createStore}=Redux;varcreateStore=Redux.createStore;我刚刚搜索了ES6const文档,它并没有完全回答我的问题,这两行如何相同? 最佳答案 这与const(这只是定

c# - WebBrowser 在 ObjectForScripting 上声明 "object type is not visible to COM"

我正在尝试使用WPFWebBrowser控件在C#和JavaScript之间建立互操作。到目前为止,C#->JavaScript调用运行良好,但我无法运行JavaScript->C#。我已经为对象创建了一个类:[ComVisible(true)]classBrowserClient{privateMainWindowowner;publicstringid="browser-client";publicBrowserClient(MainWindowowner){this.owner=owner;}publicvoidsendMessage(stringdate){owner.OnRe

javascript - 谷歌电子表格脚本 : "Cannot find function getRange in object Sheet" when creating a simple function

抱歉,这个愚蠢的问题,但我搜索了整个互联网,但找不到学习如何在GoogleSpreadSheetScript中编程的好教程。我想做一个非常简单的函数,只是为了练习。functionsimplesum(input){varss=SpreadsheetApp.getActiveSpreadsheet();varsheet=ss.getSheets();varrange=sheet.getRange(input);varx=0;for(vari=1;i我知道我可以使用=sum()来做完全相同的事情。这里的想法是学习如何编程。当我尝试在单元格中使用我的函数时:(即:=simplesum((A1