12

I have some html which seems to default to :

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

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

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

Thanks

edit: added more info

the ul id = treemenu1

and its parent element is div class = treemenu

3 Answers 3

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

Should work fine.

jsFiddle of POC.

Sign up to request clarification or add additional context in comments.

6 Comments

added more info to original post
Ok, all that does is change the selector
its the last li in my UL and the a tag is as follows: <a href="#" class="mainfoldericon">DISTRIBUTOR RESOURCES</a>
Wait, what? I thought the question was how to chang ethe top value in the ul?
yeah it is.. the UL is created within the LI to create teh sub options. IE doesnt like the javascript for the menu and is adding 72px top to the UL.. so i need to check its a certain UL based on the content of the A tag.
|
12

I would select your ul by id:

$("#treemenu1").css("top", "37px");

Also note that you can update multiple css properties at once by passing an object in, whose keys and values correspond to css properties, and their new values:

$("#treemenu1").css({ "top": "37px", "bottom": "20px" });

Comments

7
$("ul").css("top", "37px");//this should work in all browsers.

1 Comment

its the last li in my UL and the a tag is as follows: <a href="#" class="mainfoldericon">DISTRIBUTOR RESOURCES</a>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.