Skip to content

Change ElementsPerPage on windows rezize #13

Description

@msarfernandez

Hi, I need to change de value of ElementsPerPage depending on the document's width. Thats because is a responsive page. This is my code:
$(window).resize(function () { if ($(document).width() < 970) { $('#easyPaginate').easyPaginate({ paginateElement: 'section', elementsPerPage: 1, effect: 'default' }); } if ($(document).width() >= 970) { $('#easyPaginate').easyPaginate({ paginateElement: 'section', elementsPerPage: 4, effect: 'default' }); } });

When document is > 970 and y rezize it to <970, ElementsPerPage change and shows 1 in place of 4, but when I want to come back, I still have 1 element on page.

There is a better way to make it work?
Thanks!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions