bijin
bijin

Reputation: 254

dynamically add footer or header in jquery mobile

i want to add footer dynamically in my jquery mobile page..

<div data-role="page" id="homePage" data-theme="b" data-add-back-btn="true">  
  <div data-role="header"><h3></h3></div>
  <div data-role="content">
  <ul data-role="listview" id="aaa">

   </ul>
   </div> 

the i tried to add footer dynamically..

 $('#homePage').append('<div data-role="footer" data-position="fixed"><i>Copyright  &copy; 2013</i></div>').trigger( "create" );

but it doesn't work for me.

Upvotes: 2

Views: 3724

Answers (1)

Akki619
Akki619

Reputation: 2432

see this fiddle

 $('#homePage').append('<div data-role="footer" data-position="fixed"><i>Copyright  &copy; 2013</i></div>').trigger( "pagecreate" );

I have used the same code from the template of jquery website. CSS needs to be managed for this.

EDIT as pointed in below comment:

Fiddle1

Upvotes: 3

Related Questions