window.getComputedStyle——ref
componentDidMount() {
const LeftHeight = window.getComputedStyle(this.leftDom).height;
console.log(LeftHeight);
setTimeout(function(){
const LeftHeight = window.getComputedStyle(this.leftDom).height;
console.log(LeftHeight);
}.bind(this),1000)
}
return (
<ContentWarp>
<div className={ left } ref={ dom => { this.leftDom = dom } }>
<ContentLeft/>
</div>
<div className={ right }>
<ContentRight/>
</div>
</ContentWarp>
)
}
window.getComputedStyle——ref的更多相关文章
- js计算机样式window.getComputedStyle(ele,null)2
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- js计算机样式window.getComputedStyle(ele,null)与
一.getComputedStyle兼容IE8以上,范户籍的计算样式的值都是绝对值,没有相对单位(如:width:10em; 它打印出来是160px) window.getComputedStyle( ...
- window,getComputedStyle,letter-spacing
js 拿到element的css样式 window.getComputedStyle(ele,[pseuso) 比如想拿到一个element的背景色 window.getComput ...
- 关于obj.currentStyle.property、window.getComputedStyle(obj,null).property、obj.style.property的理解
首先是obj,style.property 我一直用这个obj.style.property这个属性来修改内联和外联的obj属性,但是从网上看到了obj.style.property居然只能读取内嵌的 ...
- window.getComputedStyle()方法的使用及其扩展
1.window.getComputedStyle()方法返回值 是一个可以获取当前元素所有最终使用的CSS属性值.返回的是一个CSS样式声明对象([object CSSStyleDeclaratio ...
- currentStyle与getComputedStyle应用
getComputedStyle获取的是计算机(浏览器)计算后的样式,但是不兼容IE6.7.8(主要用于非IE浏览器) currentStyle方法兼容IE6.7.8,但是不兼容标准浏览器(主要用于I ...
- style,currentStyle,getComputedStyle的区别和用法
先说说层叠样式表的三种形式(三种的叫法不一,按照各自的习惯): 一.内联样式:在HTML标签用style属性设置.如: 1 <p >这是内联样式</p> 二.嵌入样式:通过&l ...
- getComputedStyle/currentStyle/style之间的爱恨情仇
getComputedStyle是? getComputedStyle是一个可以获取当前元素所有最终使用的CSS属性值.返回的是一个CSS样式声明对象([object CSSStyleDeclarat ...
- getComputedStyle 方法
一:getComputedStyle getComputedStyle是一个可以获取当前元素所有最终使用的CSS属性值.返回的是一个CSS样式声明对象([object CSSStyleDeclarat ...
随机推荐
- python 爬取知乎图片
先上完整代码 import requests import time import datetime import os import json import uuid from pyquery im ...
- nginx基本安全优化
一.调整参数隐藏nginx软件版本号信息 查看nginx版本信息: [root@nginx conf]# curl -I 192.168.200.102 HTTP/1.1 200 OK Server: ...
- Scrapy+Chromium+代理+selenium
上周说到scrapy的基本入门.这周来写写其中遇到的代理和js渲染的坑. js渲染 js是爬虫中毕竟麻烦处理的一块.通常的解决办法是通过抓包,然后查看request信息,接着捕获ajax返回的消息.但 ...
- read design into DC memory
- BFS、模拟:UVa1589/POJ4001/hdu4121-Xiangqi
Xiangqi Xiangqi is one of the most popular two-player board games in China. The game represents a ba ...
- Linux学习-可唤醒停机期间的工作任务
什么是 anacron anacron 并不是用来取代 crontab 的,anacron 存在的目的就在于我们上头提到的,在处理非 24 小 时一直启动的 Linux 系统的 crontab 的执行 ...
- ghost模板总结
ghost模板的二次开发相对容易,附文档: http://themes.ghost.org/v0.6.0/docs/meta_title 这里有各行变量的说明. {{#is "home&qu ...
- python小数据池,代码块深入剖析
小数据池 目的:缓存我们字符串,整数,布尔值.在使用的时候不需要创建更多的对象 缓存:int,str,bool int:缓存范围-5~256 str: 1.长度小于等于1,直接缓存 2.长度大于 ...
- 异常 ndroid.view.InflateException: Binary XML file line #8: Error inflating class com.ouyang.test.MyView
发现自定义view时出现ndroid.view.InflateException: Binary XML file line #8: Error inflating class com.ouyang. ...
- C++智能指针实现
#include <iostream> #include <string> #define unsigned int size_t using namespace std; / ...