使用jquery编辑现有的内联样式? [英] edit existing inline style using jquery?

查看:115
本文介绍了使用jquery编辑现有的内联样式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些html似乎默认为:

I have some html which seems to default to :

<ul style="top: 72px; visibility: hidden;">

但是我需要Jquery来拯救我并改变顶部:72px到顶部:37px

But i need Jquery to rescue me and change top: 72px to top: 37px

这可能吗?如在Firefox 37px似乎出现,但在IE7中它显示为72px

Is this possible? as in Firefox 37px seems to show up but in IE7 it shows up as 72px

谢谢

编辑:添加更多信息

ul id = treemenu1

the ul id = treemenu1

,其父元素为div class = treemenu

and its parent element is div class = treemenu

推荐答案

$('#treemenu1').css({ top: 37 });

工作正常。

jsFiddle

这篇关于使用jquery编辑现有的内联样式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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