Sha256: a2d5cf1c9b3b845a36197246548112a211bd06adfddc140e1031b2b1fe2d5fe9
Contents?: true
Size: 1.06 KB
Versions: 54
Compression:
Stored size: 1.06 KB
Contents
/** * Rating helper-wrapper. * * @author Htmlstream * @version 1.0 * */ ;(function ($) { 'use strict'; $.HSCore.helpers.HSRating = { /** * Rating. * * @return undefined */ init: function () { var collection = $('.js-rating'); if (!collection.length) return; collection.each(function () { var $this = $(this), $target = $this.find('> *'), hoverClasses = $this.data('hover-classes'); $target.on('mouseenter', function () { $(this).addClass(hoverClasses); $(this).prevAll().addClass(hoverClasses); $(this).nextAll().not('.click').removeClass(hoverClasses); }); $target.on('mouseleave', function () { $target.not('.click').removeClass(hoverClasses); }); $target.on('click', function () { $(this).addClass('click ' + hoverClasses); $(this).prevAll().addClass('click ' + hoverClasses); $(this).nextAll().removeClass('click ' + hoverClasses); }); }); } }; })(jQuery);
Version data entries
54 entries across 54 versions & 1 rubygems