【问题标题】:Protractor get scale or scaled width and height of an element量角器获取元素的缩放或缩放宽度和高度
【发布时间】:2016-03-23 21:28:56
【问题描述】:

我的量角器有点问题。我实际上需要元素的宽度和高度。将在元素上进行变换并设置比例。

我实际上需要使用量角器缩放该元素的宽度和高度。

我已经使用 getSize() 函数获得了宽度和高度,但返回的值是原始宽度和高度,而不是缩放后的宽度和高度。

【问题讨论】:

    标签: javascript css protractor


    【解决方案1】:

    我会尝试使用clientWidthclientHeight

    protractor.promise.all([
        elm.getAttribute("clientWidth"), 
        elm.getAttribute("clientHeight")
    ]).then(function (dimensions) {
        console.log(dimensions);
    });
    

    elm.getCssValue("width")elm.getCssValue("height") 是另一种选择。

    另见:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-16
      • 1970-01-01
      • 1970-01-01
      • 2013-11-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-03
      相关资源
      最近更新 更多