如何使用document.execCommand?将字体大小更改为30px(例如)?
这个:
document.execCommand("fontSize", false, "30px");
Run Code Online (Sandbox Code Playgroud)
不起作用,因为在函数execCommand的第三个参数中,它只允许我在1到7之间输入一个值.
您好我在javascript中使用类来散列字符串:https: //ssl.bsk.com.pl/mobi/js/sha1.js
hex_hmac_sha1("927545161", "asdasdasdasd?") ;
Run Code Online (Sandbox Code Playgroud)
结果是:5db0194c834d419fc5d68b72c88af1ac8ee749d6
在PHP中我是哈希:
echo hash_hmac('sha1', "asdasdasdasd?", '927545161');
Run Code Online (Sandbox Code Playgroud)
但结果是:0b115775a20bed9922b6a9cc934cb5328fe71ade
错误在哪里?5db0194c834d419fc5d68b72c88af1ac8ee749d6!= 0b115775a20bed9922b6a9cc934cb5328fe71ade
我想在easelJS上写位图橡皮擦。我想,我已经走了一半的路了......
这是演示: http: //jsfiddle.net/bordeux/g2Lwvsuv/2/
和我的代码:
var example = function() {
this.constructor.apply(this, arguments);
};
example.prototype.constructor = function() {
this.$canvas = $("canvas");
this.container = {};
this.objects = {};
this.resizeEvents = [];
this.prepareCanvas();
this.refreshSize();
this.bindEvents();
};
example.prototype.bindEvents = function() {
var self = this;
$(window).resize(function(){
self.refreshSize();
});
};
example.prototype.refreshSize = function() {
this.stage.canvas.width = window.innerWidth;
this.stage.canvas.height = window.innerHeight;
this.resizeEvents.forEach(function(item) {
item();
});
};
example.prototype.getObject = function(name) {
return this.objects[name];
};
example.prototype.setObject = function(name, obj) {
this.objects[name] = obj;
return obj;
};
example.prototype.addResizeEvent = …Run Code Online (Sandbox Code Playgroud) javascript ×3
android ×1
canvas ×1
easeljs ×1
editor ×1
execcommand ×1
html ×1
java ×1
php ×1
sha1 ×1