代码之家  ›  专栏  ›  技术社区  ›  greggreg

SproutCore:更改鼠标事件的CSS属性

  •  0
  • greggreg  · 技术社区  · 16 年前

    在SproutCore中,当用户将鼠标移到DIV上时,我正在尝试更改它的边框厚度。所有其他代码都在工作,但我找不到如何直接访问CSS属性或向DIV附加新的类名。

    borderDiv: SC.View.design({
        layout:{top:60, left:60, width: 400, height: 525},
        classNames:"panel",
    
        mouseEntered: function(evt) {
            alert("this is working");
            //
            // No idea what to put here to change css properties
            //
            return YES
        }
    })
    
    2 回复  |  直到 15 年前
        1
  •  1
  •   hvgotcodes    15 年前

    我想你可以做点什么

    this.$().addClass()
    

    添加您想要的任何类。

        2
  •  0
  •   greggreg    15 年前

    不完全是我要找的,但最主要的工作是使用CSS伪类。:mover、:active和:focus覆盖了我使用的大多数基础。

    推荐文章