...
|
...
|
@@ -7,9 +7,6 @@ |
|
|
var $ = require('yoho-jquery'),
|
|
|
lazyLoad = require('yoho-jquery-lazyload');
|
|
|
|
|
|
|
|
|
require('../common');
|
|
|
|
|
|
var Handlebars = require('yoho-handlebars'),
|
|
|
dot = require('yoho-dotdotdot');
|
|
|
|
...
|
...
|
@@ -31,11 +28,13 @@ var newsTop = $news.offset() ? $news.offset().top : 0; |
|
|
var timeout, _id;
|
|
|
|
|
|
|
|
|
//用于临时存储数据
|
|
|
// 用于临时存储数据
|
|
|
var tempdata = {};
|
|
|
|
|
|
var templete = '<div class="brands-dialog">';
|
|
|
|
|
|
require('../common');
|
|
|
|
|
|
templete += ' <div class="brands-layer">';
|
|
|
templete += ' <div class="layer-content">';
|
|
|
templete += ' <div class="title">{{title}}</div>';
|
...
|
...
|
@@ -71,7 +70,7 @@ function getQueryString(name) { |
|
|
var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)');
|
|
|
var r = window.location.search.substr(1).match(reg);
|
|
|
|
|
|
if (r != null) {
|
|
|
if (r !== null) {
|
|
|
return window.unescape(r[2]);
|
|
|
}
|
|
|
return null;
|
...
|
...
|
@@ -89,7 +88,7 @@ if ($news.length) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
//头部图片TAB切换展示
|
|
|
// 头部图片TAB切换展示
|
|
|
$tab.eq(0).parent('li').find('.brands-content').css('z-index', '1');
|
|
|
|
|
|
_id = getQueryString('id') ? getQueryString('id') : 0;
|
...
|
...
|
@@ -121,7 +120,7 @@ $tab.hover(function() { |
|
|
clearTimeout(timeout);
|
|
|
});
|
|
|
|
|
|
//品牌类别滚动事件
|
|
|
// 品牌类别滚动事件
|
|
|
$(window).scroll(function() {
|
|
|
if ($(this).scrollTop() >= categoryTop) {
|
|
|
$gory.addClass('category-fix');
|
...
|
...
|
@@ -130,7 +129,7 @@ $(window).scroll(function() { |
|
|
}
|
|
|
});
|
|
|
|
|
|
//点击字母,页面滚动到相关区域
|
|
|
// 点击字母,页面滚动到相关区域
|
|
|
$category.click(function() {
|
|
|
var name = $(this).attr('href').split('#')[1];
|
|
|
var targetTop = $list.find('[name=' + name + ']').offset().top - categoryHeight;
|
...
|
...
|
@@ -146,8 +145,8 @@ $category.click(function() { |
|
|
});
|
|
|
|
|
|
|
|
|
//浮层代码
|
|
|
function bindTemplete($select, data, templete) {
|
|
|
// 浮层代码
|
|
|
function bindTemplete($select, data, tmp) {
|
|
|
var $this = $select;
|
|
|
var offset = {
|
|
|
width: $this.width(),
|
...
|
...
|
@@ -159,7 +158,7 @@ function bindTemplete($select, data, templete) { |
|
|
var myTemplate;
|
|
|
|
|
|
$list.find('.brands-dialog').remove();
|
|
|
myTemplate = Handlebars.compile(templete);
|
|
|
myTemplate = Handlebars.compile(tmp);
|
|
|
$parent.append(myTemplate(data));
|
|
|
dot($parent.find('.right'));
|
|
|
|
...
|
...
|
@@ -169,7 +168,7 @@ function bindTemplete($select, data, templete) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
//鼠标悬浮品牌,请求数据,并且展示
|
|
|
// 鼠标悬浮品牌,请求数据,并且展示
|
|
|
function bindHoverEvent() {
|
|
|
$brand.unbind('mouseenter').unbind('mouseleave').hover(function() {
|
|
|
var $this = $(this);
|
...
|
...
|
|