Authored by zhangxiaoru

品牌店铺

... ... @@ -4,65 +4,3 @@
* @date: 2015/10/14
*/
var $ = require('jquery');
var $categoryContainer = $('.category-container'),
$contents = $categoryContainer.children('.content'),
$subLevelItem = $categoryContainer.find('.sub-level li'),
$primaryItem = $categoryContainer.find('.primary-level li');
var $curContent = $contents.not('.hide');
//初始化container高度
(function() {
var $header = $('.yoho-header'),
$search = $('#search-input');
var h = $(window).height() - $header.outerHeight() - $search.outerHeight() - $nav.outerHeight();
$categoryContainer.css('min-height', h);
$contents.height(h);
}());
$('.category-container').bind('contextmenu', function(e) {
return false;
});
$categoryContainer.on('touchend', function(e) {
var $this = $(e.target),
$subLevel,
$cur, index;
$cur = $this.closest('.p-level-item');
if ($cur.length > 0) {
index = $cur.index();
$subLevel = $this.closest('.content').find('.sub-level');
if ($this.hasClass('focus')) {
return;
}
$this.closest('.primary-level').children('.focus').removeClass('focus');
$this.addClass('focus');
$subLevel.not('.hide').addClass('hide');
$subLevel.eq(index).removeClass('hide');
}
});
$categoryContainer.find('.primary-level').on('touchstart touchend touchcancel', 'li', function() {
$primaryItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
$categoryContainer.find('.sub-level').on('touchstart', 'li', function() {
$subLevelItem.removeClass('highlight');
$(this).addClass('highlight');
}).on('touchend touchcancel', 'li', function() {
$(this).removeClass('highlight');
});
\ No newline at end of file
... ...
... ... @@ -2,11 +2,4 @@
* 品牌店铺首页
*/
var $ = require('jquery');
$(document).ready(function() {
jQuery.jqtab = function(nav,main) {
};
// var $ = require('jquery');
... ...
... ... @@ -349,7 +349,7 @@
{{/if}}
{{!-- 品牌店铺首页 --}}
{{#if shopIndexPage}}
{{#if shop}}
<script>
seajs.use('js/prodcut/shop');
</script>
... ...