CSS
-Tricks
treehouse :
what would you like to learn today?
Web Design
Web Development
iOS Development
Show search box
Search
Search in:
All
Articles
Forums
Snippets
Videos
✕
Home
Forums
Snippets
Gallery
Videos
Almanac
Demos
Lodge
Navigation 'n' Search
Forums
Illustration by Nick Sirotich
Forums
»
JavaScript Jungle
Position dropdown menues using jquery
RohanJM
Permalink to comment
#
December 2009
Hi how do I get the width and height of an element and then use it position a dropdown menu… if I use css the same rule doesn’t seem to work in ie and since I anyway need jquery I might as well use it.
Thanks
Robskiwarrior
Permalink to comment
#
December 2009
What I would do is store it in a var.
var itemWidth = $("myElement").width();
var itemHeight = $("myElement").height();
that should get you your values stored in "itemWidth" and "itemHeight"
Add a Comment
Thanks
var itemWidth = $("myElement").width();
var itemHeight = $("myElement").height();
that should get you your values stored in "itemWidth" and "itemHeight"