Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Last active May 28, 2020 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save szepeviktor/57d9bc477b65e336c350777aa2072867 to your computer and use it in GitHub Desktop.
Save szepeviktor/57d9bc477b65e336c350777aa2072867 to your computer and use it in GitHub Desktop.
Görgetés a kategóriákhoz a Netpincér-en
var netpincerScroll = function (event) {
var $elem = jQuery(event.target);
var id = $elem.data("public-id");
var $header = jQuery(".item-list .category-header[data-public-id=" + id + "]");
$elem.parent().siblings().removeClass("selected");
$elem.parent().addClass("selected");
jQuery("html").scrollTop($header.position().top - 73 - 15 - 60);
};
jQuery(".filter-box .filter-assortment > li > a[data-name]").each( function (_, elem) {
var $elem = jQuery(elem);
$elem.unbind();
$elem.removeAttr("href");
$elem.bind("click", netpincerScroll);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment