Search code examples
javascriptpluginspaginationjquery-pagination

installing javascript plugin


im trying to set up a pagination plugin, one that does not load the entire page, only refreshes the content. the plugin i found at http://botmonster.com/jquery-bootpag/#example-full is looking spot on. (correct me please if thats not what i was trying to explain before LOL) looks simple and all. but i just dont know where to put the codes. i already placed the .js file under js folder on the bootstrap main folder. and i understand you put a script tag on the index but then thats where im at. and another thing. do i still need to make a bunch of htmls for when the content changes? and thats all :D thanks for your time.


Solution

  • Go to bootpag website's main page (http://botmonster.com/jquery-bootpag/#example-full). Under the first section, Installation, there's the Getting Started one, in which you can find all the information you need; there's also some code that the developers of this plugin wrote to explain you how to basically set up a webpage that uses their plugin. You first prepare an empty html element which should contain pagination (bootpag will create pagination list). After page load init bootpag with number of total page pages $('.my-element').bootpag({total: 15}). From now on you can listen for page changes $('.my-element').on("page", function(event, num){}). Go to the link I wrote, and you will find a complete example of what you need to do, plus the overall Documentation and clear examples.