我想为我的图标字体做一个后备.例如,对于我漂亮的图标字体复选标记我使用Unicode复选标记等效:
.icon-checkmark {
&:before {
content: "\2713"; /* Unicode Character 'CHECK MARK' (U+2713) */
}
}
Run Code Online (Sandbox Code Playgroud)
我的图标字体也有代码"\ 2713"的字符.如果我的图标字体无法加载,用户将看到Unicode复选标记; 如果图标字体加载成功,用户将看到图标字体的漂亮复选标记.
我正在为« email »,« save »和« print »实体搜索Unicode字符等价物.Unicode表中是否有任何类似的内容?我在http://www.fileformat.info/上搜索过但没有运气.
(我发现只有一个"电子邮件"字符 - http://www.fileformat.info/info/unicode/char/1f4e7/browsertest.htm,但它在Chrome 28中不起作用(但它适用于所有其他浏览器: ).
我在RequireJS的开发配置(在"index.html"文件中)是:
<script src="require-2.1.5.min.js"></script>
<script>
require.config({
baseUrl: 'js',
paths: {
angular: 'libraries/angular-1.1.5.min',
jquery: 'libraries/jquery-2.0.0.min',
underscore: 'libraries/underscore-1.4.4.min',
...
zeroclipboard: 'plugins/zeroclipboard-1.0.7.min',
tablesorter: 'plugins/jquery.tablesorter-2.9.1.min',
...
},
shim: {
'angular': {
exports: 'angular'
},
'underscore': {
exports: '_'
}
},
packages: [
{
name: 'index',
location: 'app/index',
main: 'main'
}
]
});
require(['index']);
</script>
Run Code Online (Sandbox Code Playgroud)
但在生产中,我只有2个用于库和插件的连接文件:
js/libraries.js // all jQuery, AngularJS, RequireJS, Underscore and other libraries concatenated
js/plugins.js // all plugins (already an AMD modules, no need for "shim" config) concatenated
Run Code Online (Sandbox Code Playgroud)
那么,我现在如何编写配置"路径"?我没有任何'libraries/angular-1.1.5.min.js'和其他路径.
我的解决方案是写:
paths: …Run Code Online (Sandbox Code Playgroud) 如果我完全禁用$ sce服务会发生什么不好的事情?
angular.module('app').config(function ($sceProvider) {
$sceProvider.enabled(false);
});
Run Code Online (Sandbox Code Playgroud) 我想使用Polygon类和lat/lng坐标数组在Google Maps上绘制城区区域.
OpenStreetMap为我提供了我需要的所有数据 - 如果我输入一些区域名称,我可以获得OSM XML格式的有用数据,例如拉脱维亚里加的"Vecmilgravis"区的OSM绘制多边形,以及OSM XML格式的数据.
问题是所有这些node节点都按照一些奇怪的顺序排序,所以如果我只提取所有lat和lng对并为Google Maps Polygon类创建一个坐标数组,我看不到我所期望的:
标记正确显示'cos坐标顺序对他们来说并不重要,但是多边形被弄乱'错误的坐标顺序我从OSM数据中复制了.
那么,如何以正确的顺序提取(或手动排序)OSM节点坐标?
我的根模块中有一个标准的锤子手势自定义配置:
\n\nimport { HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';\nimport { HammerGestureConfig } from '@angular/platform-browser';\n\nexport class CustomHammerConfig extends HammerGestureConfig {\n overrides = {\n pan: {\n direction: 6 // this code enables only horizontal direction\n },\n pinch: {\n enable: false\n },\n rotate: {\n enable: false\n }\n };\n}\n\n@NgModule({\n declarations: [\n AppComponent\n ],\n imports: [\n //\n ],\n providers: [\n //\n {\n provide: HAMMER_GESTURE_CONFIG,\n useClass: CustomHammerConfig\n }\n ],\n bootstrap: [\n AppComponent\n ]\n})\nRun Code Online (Sandbox Code Playgroud)\n\n我有一个 Carousel 组件,它必须只能水平平移,因此 Carousel 组件块上的垂直平移不会阻止移动设备中的整个页面滚动。
\n\n因此,全局 Hammer 手势配置适用于我的 Carousel 组件。
\n\n但我有另一个组件 …
如何在AngularJS中命名我的DOM事件?
我有一些指令绑定文档上的鼠标事件:
$document.on('mousemove');
$document.on('mouseup');
Run Code Online (Sandbox Code Playgroud)
在做完鼠标之后我做了:
$document.off('mousemove');
$document.off('mouseup');
Run Code Online (Sandbox Code Playgroud)
然后其他一些指令不起作用,因为事件被破坏了.
在Angular的angular.element文档中写道:
on() — Does not support namespaces, selectors or eventData
Run Code Online (Sandbox Code Playgroud)
好吧,但我认为我需要事件命名空间来定位要删除的事件.所以我该怎么做?
我想制作具有平滑小缩放图像效果的 30 秒视频。我所做的:
ffmpeg -y -loop 1 -i 1.png -vf "zoompan=z='min(max(zoom,pzoom)+0.0015,1.1)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s='1000x1000'" -c:v libx264 -t 30 1.mp4
如何在 30 秒(所有视频时间)内修改我的 ffmpeg zoompan 参数以获得缩放效果?现在它会产生 3 秒的效果。文档说:
d — Set the duration expression in number of frames. This sets for how many number of frames effect will last for single input image.
但是我的实验d失败了。谢谢!
为什么jQuery没有:readonly选择器?
有:checked和:selected和:用于输入的禁用选择器.那么,为什么没有:readonly选择器?我的意思是,作为"编码糖".
因为所有这些方括号都很难看 - ".('[readonly]')".为什么没有".is(':readonly')"?
也许有一些原因:readonly选择器不存在?
angularjs ×2
angular ×1
config ×1
dom ×1
escaping ×1
events ×1
ffmpeg ×1
gesture ×1
google-maps ×1
hammer.js ×1
icon-fonts ×1
icons ×1
javascript ×1
jquery ×1
polygon ×1
readonly ×1
requirejs ×1
security ×1
side-effects ×1
unicode ×1