Is there some reason the more standards based media queries technique won't work for what you're trying to acheive?
CSS:
@media only screen and (orientation : landscape){
/* css inside this block only affects width>height situations */
}
@media only screen and (orientation : portrait){
/* css inside this block only affects height<width situations */
}
These styles will automatically kick in when an orientation change occurs - so you don't need to listen for window.resize().
--------
If, for some reason, you need to also trigger events when a change occurs, there are a number of methods at your disposal - the least effective & most expensive one being listening for window.resize() (this should only be done on legacy IE browsers).
A more detailed breakdown of some of the techniques you can use is available at this link.