jQuery Mobile JS-commands problem

jQuery Mobile JS-commands problem

Hi! I'm new to jQuery and I'm sorry if this has been asked before, but I have spent hours on this forum and on Google but to no effect.

I have built a well working jQM version of my wordpress site and I'm quite happy with the way it looks and works with one exception. When you turn your phone to landscape orientation the top header takes up too much space. So I dove into the JS part of jqm to change the fixedtoolbar behavior on orientation change. 

To the problem: None of the jqm commands such as  $("[data-position='fixed']").fixedtoolbar('show/hide/toggle'); $.mobile.changePage(), $.mobile.loading() work... I can't get any of the jqm commands to be recognized by either firefox, chrome, iphone or android. Firebug sais the commands have TypeErrors.

I have tried every position I can think of for the script, in the header, in between jquery-1.8.2.min.js and jquery.mobile-1.2.0.min.js. Inside the page div, in the end of the html-file. No difference. I have tried on page init, on header init but it wont work.

The code below runs and shows the alert but doesn't recognize the second command. I have pushed the orientation-change aside for now, I would be happy only if this litte snippet would work:
  1. (function() {

  2. $( '#jqm-home' ).live( 'pageinit',function(event){
  3.   alert( 'Page loaded...' );
  4.   $("[data-position='fixed']").fixedtoolbar('hide');
  5. });

  6. })();