UE.commands['signset'] = { execCommand : function(){ alert('123'); }, queryCommandState:function(){ var images = this.document.getElementsByTagName("img" ); for(var i=0;i<$(images).length;i++){ if($(images[i]).css("width")!="100px"){ return 0; //如果找到宽度不为100的图片,则返回0,代表当前按钮可以点击 } } return -1; //否则返回-1,告诉编辑器将当前按钮置灰 } };