zoukankan      html  css  js  c++  java
  • CKEDITOR 3.4.2中 按钮事件中 动态改变图标和title 获取按钮

    this.uiItems[0].className="cke_button_hui_position_type";
    this.uiItems[0].title="zhang";
    //上面2中只是获取,修改后不管用

    this.uiItems[0]._.id //获取ID

    //只能通过jquery,找到id或classname来找到,然后修改
    $("#cke_18")[0].title

    完整代码:
     editor.addCommand('sunyard_position_type',{
                exec:function(editor){
                    CKEDITOR.positionType = CKEDITOR.positionType=='absolute'?'static':'absolute';
                    //动态设置图标title和lable
                    $("." + this.uiItems[0].className)[0].label= lang[CKEDITOR.positionType];
                    $("." + this.uiItems[0].className)[0].title= lang[CKEDITOR.positionType];
                    //改变图标
                    //alert(editor.plugins.sunyard_position_type.path);
                    if(CKEDITOR.positionType=="absolute") {
                        $("."+this.uiItems[0].className)[0].children[0].style.backgroundImage="url("+editor.plugins.sunyard_position_type.path+ "icons/sunyard_position_type_absolute.gif"+")";
                    }else{
                        $("."+this.uiItems[0].className)[0].children[0].style.backgroundImage="url("+editor.plugins.sunyard_position_type.path+ "icons/sunyard_position_type_static.gif"+")";
                    }
                }
            });



  • 相关阅读:
    Shell编程基础
    lenovo future leaer deveolpmetn program
    求1+2+...+n
    Linux下使用qq
    判断2个线段是否相交
    java大数相加
    Django路由系统
    Django框架
    HTTP协议及Django配置
    mysql索引
  • 原文地址:https://www.cnblogs.com/hutuchong/p/6513219.html
Copyright © 2011-2022 走看看