Authored by ccbikai

侧边栏 品牌一览 频道选择 点击背景色变化

... ... @@ -64,6 +64,18 @@ $(window).scroll(function() {
});
});
function changeBackground() {
var $brandList = $('.brand-list').find('p');
$brandList.on('touchstart', function() {
$brandList.css('background', '#fff');
$(this).css('background', '#eee');
}).on('touchend touchcancel', function() {
$(this).css('background', '#fff');
});
}
changeBackground();
function searchResult() {
var keyword = ($keyword.val() + '').toLowerCase();
var result = {},
... ... @@ -113,6 +125,7 @@ function searchResult() {
// 插入 dom,绑定事件
$('.search-result').html(html);
changeBackground();
}
if ($('.brand-search-page').length) {
... ...
... ... @@ -94,6 +94,14 @@ $subNav.each(function () {
}
});
// 侧边栏点击背景色变化
$sideNav.children('ul').children('li').on('touchstart', function() {
$sideNav.children('ul').children('li').css('background', '#fff');
$(this).css('background', '#eee');
}).on('touchend touchcancel', function() {
$(this).css('background', '#fff');
});
//头部banner轮播
if ($('.banner-swiper').find('li').size() > 1) {
bannerSwiper = new Swiper('.banner-swiper', {
... ...
... ... @@ -8,7 +8,8 @@ var $ = require('jquery');
var $searchBox = $('.search-box'),
$box = $('.box'),
$indexSearch = $('.index-search'),
$indexLogo = $('.index-logo');
$indexLogo = $('.index-logo'),
$channelLink = $('.index-channel a');
var $search = $searchBox.children('input[type="text"]'),
$cancelSearch = $box.children('.no-search'),
... ... @@ -41,3 +42,22 @@ $searchBox.children('.clear-text').on('touchstart', function() {
$searchBox.children('.search-icon').on('touchstart', function() {
$indexSearch.submit();
});
$channelLink.on('touchstart', function() {
$channelLink.css({
background: '#000',
color: '#fff',
borderColor: '#fff'
});
$(this).css({
background: 'rgba(255, 255, 255, 0.5)',
color: '#000',
borderColor: '#000'
});
}).on('touchend touchcancel', function() {
$(this).css({
background: '#000',
color: '#fff',
borderColor: '#fff'
});
});
... ...