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

plugin initializing and compounding centered values with jquery mobile #11

Open
gr33my opened this issue Jan 28, 2014 · 0 comments
Open

Comments

@gr33my
Copy link

gr33my commented Jan 28, 2014

I'm trying to to use the plugin withthe newest jQuery Mobile(1.4.0). It works great except for the centering processing and positioning values seems to be doubling up when pages any pages past the initial load are navigated too.

I had hoped to just call the plugin on a global page create. Obviously this is just recalling the plugin on each pageshow and the centered values are adding onto each other. Is there a way to initiate a 'clean' or 'destroy' on the plugin elements before they are initialized without having to create a hack outside of the plugin?

Any help would be greatly appreciated. Love the plugin. Aside from this issue its perfect for working in a framework like jQM :-)

here is my basic code for some context:

$( document ).on( "pagecreate", function( event, ui ) {

   $('.img-thumb-wrapper img').centerImage();

});
<span class="img-thumb-wrapper lrg-thumb">
   <img src="/upload/Sam Tripoli2.jpg">
</span>
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

1 participant