转换div jquery后如何获得新位置? [英] How to get new position after transform div jquery?

查看:102
本文介绍了转换div jquery后如何获得新位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

转换后如何获得新职位?谁能帮我做到这一点.

How to get new position after transform? Can anybody please help me to do that.

我用过

$('#text').css('-moz-transform','rotate(90deg)');

现在我想获得左右位置.

Now I want to get left and right postion.

当我尝试获得左位置和顶部位置时,它显示了变换之前的左位置和顶部位置

When I try to get left and top position it shows left and top position before transform

$('#text').position().left;    
$('#text').position().top;

它显示div转换之前的位置

It shows position before div transform

我想获得新职位. 我该怎么办?

I want to get the new position. How do i do that?

推荐答案

console.log($('#text').offset().left);
console.log($('#text').offset().top);

在Chrome中,我得到的结果与在Firefox中相同

I've got the same result as in Chrome as in Firefox

这篇关于转换div jquery后如何获得新位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆