More than 5 items per line in jQuery Mobile navbar

前端 未结 8 1290
青春惊慌失措
青春惊慌失措 2021-02-01 17:45

I have unsuccessfully looked for a variable to change the maximum number of items in a single line in a navbar.

I am just starting with jQuery Mobile, trying to create

8条回答
  •  情歌与酒
    2021-02-01 18:12

    You can try another way to add items in navbar as many as you required. Let me explain.

    HTML of navbar is as fallows.

    Add this Jquery function to remove class ui-grid-a from

      that limits the number of items on navbar.

      $(document).ready(function() {
      
          $("#my-navbar > ul").removeClass("ui-grid-a");
      
      });
      

      Now you will have to calculate the width of each navbar item OR you can set it manually. In this example we have 7 items to display on navbar and we want to divide the space equally to each item.

      For a PHP page we will do this.

      
      
      
      
      
      

      For static HTML pages you can set the width of each item manually

      
      

      Thats it :)

      I have used it for me and it works fine.

提交回复
热议问题