开发者

How can i position an a div with javascript in Safari?

开发者 https://www.devze.com 2023-02-17 09:57 出处:网络
I need to move a div with javascript. i\'ve tried offsetTop/Left and I\'ve tried style.top/left. but it doesnt work. style.top/left works in IE but not safari

I need to move a div with javascript. i've tried offsetTop/Left and I've tried style.top/left. but it doesnt work. style.top/left works in IE but not safari

document.getElementBy开发者_开发百科Id('links_safari').offsetTop= 20;
document.getElementById('links_safari').offsetLeft = 150;


Your question is tagged with jQuery, so using jQuery, I would suggest changing the margin CSS property.

$('#links_safari').css("margin-top", 20);
$('#links_safari').css("margin-left", 150);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号