Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
8f40b67666ff1b74d9f922ebfc43b480cb2c018c
1 parent
833e72ce
侧边栏 品牌一览 频道选择 点击背景色变化
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
1 deletions
static/js/category/brand.js
static/js/home/home.js
static/js/index/channel.js
static/js/category/brand.js
View file @
8f40b67
...
...
@@ -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
)
{
...
...
static/js/home/home.js
View file @
8f40b67
...
...
@@ -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'
,
{
...
...
static/js/index/channel.js
View file @
8f40b67
...
...
@@ -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'
});
});
...
...
Please
register
or
login
to post a comment