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

Click Function in Stackable.js Table? #55

Open
jinch opened this issue Apr 1, 2017 · 1 comment
Open

Click Function in Stackable.js Table? #55

jinch opened this issue Apr 1, 2017 · 1 comment

Comments

@jinch
Copy link

jinch commented Apr 1, 2017

Not sure I stumbled on a bug, but recently I found that my stackable table using "stackable.js" will not run a click function calling toggleClass on an element. It works fine in desktop view but when scaled down and the stackable.js is triggered, my function stops working. This is only happening when the table is stacked and is only effecting elements inside the table.

Here is the Jquery function I'm hoping to get to work on the stacked table:
`/START WISH LIST STAR TOGGLE + MODAL/
$(document).ready(function() {
"use strict";
$('.product table span.star').on('click', function() {
$(this).toggleClass('active');

	if($(this).hasClass('active')){
		$('#wishListModal').foundation('open');
	}
});

/*This is needed to redraw the slick coursel in the modal as dimentions are not properly calculated (due to it initialy hidden)*/
$('[data-reveal]').on('open.zf.reveal', function() {
	$('.slick-slider').resize();
});

});
/END WISH LIST STAR TOGGLE + MODAL/`

Any advice or insight on the issue is much appreciated.

@jinch
Copy link
Author

jinch commented Apr 4, 2017

If anyone has a similar issue it was due to CSS specificity. By adjusting my click function to scope the body I was able to work around the issue.

Like so:
$('body').on('click', '.product table span.star', function() {..}

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