Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple jPages controls and 'destroy' method #10

Open
vpiyanov opened this issue Jun 18, 2012 · 4 comments
Open

Multiple jPages controls and 'destroy' method #10

vpiyanov opened this issue Jun 18, 2012 · 4 comments

Comments

@vpiyanov
Copy link

The 'destroy' is destroying incorrect jPages control in case multiple jPages controls exist on the page.

To reproduce see: http://jsfiddle.net/HNKEz/
Change value in the first combobox and both jPages controls get broken.

@michellcampos
Copy link

Anybody find a solution to this?

@dracoheimerich
Copy link

...not sure if there're still people with this problem
actually the plugin didn't seem to be built to cater with multiple instances,
the only workaround I could think of and actually work, is to copy the js file and probably name it jPages2.js, and replace all instances of "jPages" to "jPagestwo" inside the new js file, go on the number line if you have more than 2, and call functions using .jPages(), jPagestwo() and so on,
please kindly let me know if there're any better ways... but this works for me - the bottom line

@vpiyanov
Copy link
Author

2 years ago I have submitted pull request with fix: #12

@katieschrader
Copy link

I wrote my own Destroy function based on what was in the plugin.

// holder == The pagination holder
// container == The container for the items to pagination
// item == The item that is being paginated through

function destroyJPages(holder, container, item) {

  $(container).unbind("keydown.jPages");
  $(container).unbind("mousewheel.jPages DOMMouseScroll.jPages");
  $(container).css("min-height", "");
  $(container+" "+item).css("display","initial");
  $(holder).removeClass("animated jp-hidden jp-invisible ");
  $(holder).removeClass("jp-hidden").fadeTo(0, 1);
  $(holder).unbind("click.jPages").empty();

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants