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
biao
9 years ago
Commit
f88013af49c4eb78a0a521c749ab655d93b1dfd0
1 parent
c94c7a39
fix flex display issue. code review by LZF
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
54 deletions
static/js/product/detail/desc.js
static/sass/product/_detail.scss
static/js/product/detail/desc.js
View file @
f88013a
...
...
@@ -37,19 +37,28 @@ function hiddenTips($ele) {
}
}
function
isFlexSupport
()
{
var
flex
=
document
.
createElement
(
'p'
).
style
.
flex
,
webkitFlex
=
document
.
createElement
(
'p'
).
style
.
webkitFlex
,
flexWrap
=
document
.
createElement
(
'p'
).
style
.
flexWrap
;
if
((
flex
===
''
||
webkitFlex
===
''
)
&&
flexWrap
===
''
)
{
return
true
;
}
else
{
return
false
;
}
//function isFlexSupport() {
// var flex = document.createElement('p').style.flex,
// webkitFlex = document.createElement('p').style.webkitFlex,
// flexWrap = document.createElement('p').style.flexWrap;
//
// if ((flex === '' || webkitFlex === '') && flexWrap === '') {
// return true;
// } else {
// return false;
// }
//}
function
wrapElements
(
selector
,
count
)
{
$
(
selector
).
each
(
function
(
idx
,
el
)
{
if
(
idx
%
count
===
0
)
{
$
(
$
(
selector
).
slice
(
idx
,
idx
+
count
)).
wrapAll
(
$
(
'<div class="js-wraper"></div>'
));
}
});
}
function
search
()
{
if
(
searching
||
end
)
{
return
;
...
...
@@ -84,9 +93,10 @@ function search() {
hiddenTips
(
$
(
'#size-swiper-container'
));
hiddenTips
(
$
(
'#reference-swiper-container'
));
if
(
!
isFlexSupport
())
{
$
(
'.detail .column'
).
removeClass
(
'column'
).
addClass
(
'oldbox'
);
}
//if (!isFlexSupport()) {
// $('.detail .column').removeClass('column').addClass('oldbox');
//}
wrapElements
(
'.detail .column'
,
2
);
searching
=
false
;
end
=
true
;
loading
.
hideLoadingMask
();
...
...
static/sass/product/_detail.scss
View file @
f88013a
...
...
@@ -41,50 +41,53 @@ $basicBtnC:#eb0313;
}
&
.table
{
@include
flexbox
((
.js-wraper
{
@include
flexbox
((
display
:
box
,
box-lines
:
multiple
,
box-pack
:
start
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
flex-wrap
:
wrap
,
justify-content
:
flex-start
));
width
:
100%
;
.column
{
box-sizing
:
border-box
;
//padding: pxToRem(20px) pxToRem(12px);
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
border
:
1px
solid
#fff
;
font-size
:
pxToRem
(
24px
);
background-color
:
$tableCellC
;
word-wrap
:
break-word
;
@include
flexbox
((
box-flex
:
1
.0
,
display
:
box
,
box-align
:
center
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
align-items
:
center
,
flex-basis
:
49
.9%
))
}
.oldbox
{
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
background-color
:
$tableCellC
;
box-sizing
:
border-box
;
border
:
1px
solid
#fff
;
width
:
49
.9%
;
height
:
100%
;
float
:
left
;
text-overflow
:ellipsis
;
white-space
:nowrap
;
overflow
:hidden
;
}
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
flex-wrap
:
wrap
,
justify-content
:
flex-start
));
}
width
:
100%
;
.column
{
box-sizing
:
border-box
;
//padding: pxToRem(20px) pxToRem(12px);
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
border
:
1px
solid
#fff
;
font-size
:
pxToRem
(
24px
);
background-color
:
$tableCellC
;
word-wrap
:
break-word
;
@include
flexbox
((
box-flex
:
1
.0
,
display
:
box
,
box-align
:
center
)
,
$version
:
1
);
@include
flexbox
((
display
:
flex
,
align-items
:
center
,
flex-basis
:
49
.9%
))
}
.oldbox
{
padding
:
pxToRem
(
6px
)
3%
;
width
:
49
.9%
;
background-color
:
$tableCellC
;
box-sizing
:
border-box
;
border
:
1px
solid
#fff
;
width
:
49
.9%
;
height
:
100%
;
float
:
left
;
text-overflow
:ellipsis
;
white-space
:nowrap
;
overflow
:hidden
;
}
}
}
}
...
...
Please
register
or
login
to post a comment