sort-pager.js 629 Bytes
/**
 * 筛选页和列表页操作banner中的每页N个商品选择逻辑
 * @author: xuqi<qi.xu@yoho.cn>
 * @date: 2015/12/4
 */

var $ = require('yoho-jquery');

var $countPerPage = $('#count-per-page'),
    $countChose = $countPerPage.next('ul');

var SLIDETIME = 200;

$(document).click(function(e) {
    if ($(e.target).closest('.page-count').length > 0) {
        return;
    }

    $countChose && $countChose.slideUp(SLIDETIME);
});

$countPerPage.click(function() {
    if ($countChose.css('display') === 'none') {
        $countChose.slideDown(SLIDETIME);
    } else {
        $countChose.slideUp(SLIDETIME);
    }
});