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"
});
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"
});
Share
Improve this question
edited May 3, 2013 at 10:17
Anujith
9,3706 gold badges35 silver badges48 bronze badges
asked May 3, 2013 at 10:02
AlasdairAlasdair
14.2k18 gold badges93 silver badges151 bronze badges
2
- 1 for more flexibity, wrap your attributes and their values in quotes to make it work in every browser. – Rohit416 Commented May 3, 2013 at 10:10
- when you inspect linechart, you don't see the z-index in firebug? – Amr Elgarhy Commented May 3, 2013 at 10:20
2 Answers
Reset to default 11You have to define like this:
"z-index": "5"
Or uppercase if you don't want to define in quotes:
zIndex: "5"
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