mandiwise / isotope-posts

[RETIRED] This plugin allows you to use Metafizzy's Isotope javascript plugin to display feeds of WordPress posts with a simple shortcode. Works with custom post types and custom taxonomies too.
GNU General Public License v2.0
55 stars 17 forks source link

'See All' button scrolls the page back to the top #17

Closed asoretmadolell closed 9 years ago

asoretmadolell commented 9 years ago

Hello again!

Sorry in advance if this is actually a problem with the isotope filtering and not your plugin's!

I recently had to add isotopes to a page where you need to scroll down in order to see them well because there is more relevant content first. Everything works alright, except that when clicking on the 'See All' button, the page scrolls way back to the top, although the isotopes keep working (and eventually shows them all), and you have to scroll back down again.

I thought this could be due to there being an <a href="#"> wrapping the button, but I haven't been able to solve it myself.

I've seen this problem before, and I was told it was easy to fix. So, if you could at least please take me to a website where this has been discussed before, I would be very grateful!

Thank you!

ghost commented 9 years ago

I'm having the same issue!

mandiwise commented 9 years ago

Yikes...you're right. Definitely missing and event.preventDefault() on the click event. I release an update with a patch for this shortly. Thanks for bringing this to my attention.

mandiwise commented 9 years ago

Hello again. This bug proved to be a little trickier to squash than I originally anticipated, but it has been fixed as of v2.0.9. However, the fix will only work in IE10+ and other modern browsers. You can see a full list of supported browsers for this fix here: http://caniuse.com/#feat=history

asoretmadolell commented 9 years ago

Excellent. Just tried it out and works like a charm. One last question, would it be too difficult to add the "See All" link to another element in the DOM using jQuery? Thank you so much. I really think you should be open to donations :D

ghost commented 9 years ago

It works for me also, Mandi. Thank you very much!

mandiwise commented 9 years ago

@asoretmadolell I'm guessing you want to have some other element (like a button) to attach the "See All" click event to? At the moment, this wouldn't really work with the way the JS and mark-up are written. But I'll can look into refactoring it slightly to make this possible in a future release.