I want to carry out two different functions based on the height of a div. How would I write out a conditional that checks the style before deciding?
+3
A:
You have:
var e = $("someSelectorThatGetsTheElement");
if (e.height() < 50) {
// do something;
} else {
// do something else;
}
EDIT: I made a small mistake, e.height is actually a function, so need to add the "()".
Prody
2009-10-10 18:15:29
A:
You can use the height() method. The css(name) method can be used to return any style property.
kgiannakakis
2009-10-10 18:16:32