我正在尝试创建一个包含我的业力测试输出的xml文件.我的配置如下,但我没有得到一个xml文件+我在一些junits插件上收到错误.我该如何安装?
'use strict';
module.exports = function(config) {
config.set({
autoWatch : false,
reporters: ['progress', 'junit'],
frameworks: ['jasmine'],
browsers : ['PhantomJS'],
plugins : [
'karma-phantomjs-launcher',
'karma-jasmine'
],
junitReporter: {
outputFile: 'test-results-karma.xml',
suite: ''
}
});
};
Run Code Online (Sandbox Code Playgroud)
以cmd输出
[10:50:55] Using gulpfile C:\projects\gulpfile.js
[10:50:55] Starting 'test'...
[10:50:56] Starting Karma server...
WARN [reporter]: Can not load "junit", it is not registered!
Perhaps you are missing some plugin?
INFO [karma]: Karma v0.12.31 server started at http://localhost:9876/
INFO [launcher]: Starting browser PhantomJS
INFO [PhantomJS 2.0.0 (Windows 8)]: …Run Code Online (Sandbox Code Playgroud) 我有这个函数来移动绝对DIV,我想执行setTimeout函数.但是,当涉及行$().finish()时,JQuery跳出hover()函数.如何在完成()之后执行某些操作?
$('#header li[class!="logo"]').hover(function () {
var leftStart = $(this).position().left;
var width = ($(this).width() / 2) - 22;
$('#header .pointerarrow').animate({ left: leftStart + width }, 400);
}, function () {
$('#header .pointerarrow').finish();
//######This does not excecute###########
setTimeout(function () {
alert('succeeded');
var l = $('#header li[class="current"]').position().left;
var b = ($('#header li[class="current"]').width() / 2) - 22;
$('#header .pointerarrow').css({ left: l + b });
}, 500);
});
Run Code Online (Sandbox Code Playgroud) 我有一个Angular MD模板,它使用大屏幕上的行布局和移动设备上的列布局.但是,在手机上的大多数标准浏览器中,我都会得到一个奇怪的结果,即列太大了.我有不同的屏幕显示它应该是什么样子.
我的简化代码(3行/列)如下所示
<div layout="row" layout-align="center center">
<div flex="50" flex-sm="90" flex-md="80" class="row3" layout="row" layout-sm="column">
<div flex="40" flex-sm="100" layout="row" layout-align "center start">
<!-- first column -->
</div>
<div flex="20" flex-sm="100" style="background: #2AFF00">
<!-- second column -->
</div>
<div flex="40" flex-sm="100" layout="row" layout-align="center start">
<!-- Third column -->
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud) 我正试图在我的角度代码的配置中动态设置Angular MD主题的颜色.但我似乎无法改变它...我希望primaryPalette在由themeChangerAdjustment触发器更改时更改为变量颜色.
var color = red;
angular.module('myApp', ['ngResource', 'ui.router', 'ui.bootstrap', 'ngMaterial'])
.config(['$mdThemingProvider', function($mdThemingProvider) {
$mdThemingProvider.theme('default').primaryPalette(color).accentPalette('orange');
}])
.run(['$log','$rootScope', 'themeChangerService', function($log,$rootScope, themeChangerService){
$rootScope.$on('themeChangerAdjustment', function(){
alert(themeChangerService.themes.color);
color = themeChangerService.themes.color; //works
});
themeChangerService.prepForAdjustment(1);
}]);
Run Code Online (Sandbox Code Playgroud) 我的HTML页面中有5个选择框,我正在尝试禁用已选中的其他选择框中的所有选项,取消选择它们时也必须重新启用它们.
到目前为止,我得出了这个结果:点击此处查看JSFiddle
使用这个JQuery
$('.poli').on('keyup change', function () {
$(this)
.siblings('select')
.children('option[value=' + this.value + ']')
.attr('disabled', true)
.siblings().removeAttr('disabled');
});
Run Code Online (Sandbox Code Playgroud)
然而,这不能很好地工作,它当时只选择和禁用1个选项...
有解决方案吗