0

How is it that this works:

$("#linechart").css({
      position:'fixed',
      top: "4%",
      left: "2%",
      height: "92%",
      width: "96%"
  });

and this breaks all the javascript:

$("#linechart").css({
      position:'fixed',
      top: "4%",
      left: "2%",
      height: "92%",
      width: "96%",
      z-index: "5"
  });
2
  • 1
    for more flexibity, wrap your attributes and their values in quotes to make it work in every browser. Commented May 3, 2013 at 10:10
  • when you inspect linechart, you don't see the z-index in firebug? Commented May 3, 2013 at 10:20

2 Answers 2

11

You have to define like this:

"z-index": "5"

Or uppercase if you don't want to define in quotes:

zIndex: "5"
Sign up to request clarification or add additional context in comments.

Comments

1

Try this

$("#linechart").css({
      position:'fixed',
      top: "4%",
      left: "2%",
      height: "92%",
      width: "96%",
      'z-index': "5"
});

and reason is when we use css in jQuery we have to write like this if the word has space in between words

Comments

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.