View unanswered posts | View active topics It is currently 2019-10-19 1:25



Reply to topic  [ 3 posts ] 
 画布出现滚动条之后如何获取elemet的clientx ,或者滚动条的长度 
Author Message
新手上路

Joined: 2019-04-03 17:52
Posts: 3
Post 画布出现滚动条之后如何获取elemet的clientx ,或者滚动条的长度
画布出现滚动条之后如何获取元素clientx ,或者滚动条的长度
getPosition获取的offsetX(包含滚动条的长度),有没有办法获取clientX(不包含滚动条的长度)


2019-05-05 17:45
Profile
新手上路

Joined: 2019-04-23 11:02
Posts: 16
Post Re: 画布出现滚动条之后如何获取elemet的clientx ,或者滚动条的长度
可以试试
network.getView().addEventListener('mousedown', function (e) {
console.log(e.clientX)
});


2019-05-06 10:19
Profile
新手上路

Joined: 2019-04-23 11:02
Posts: 16
Post Re: 画布出现滚动条之后如何获取elemet的clientx ,或者滚动条的长度
监听元素的可以用这个
network.addInteractionListener(function (e) {
if (e.kind === 'clickElement') {
console.log(e.event.offsetX)
}
});


2019-05-06 10:39
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron