Authored by wangqing

增加出入弹框

... ... @@ -750,6 +750,73 @@ function actionTipPic() {
});
}
function closeCover(){
var $cover = $('#cover');
$cover.remove();
}
/**
* 首次进入有弹窗
* @return {[type]} [description]
*/
function actionCover() {
var gender = cookieMap._Gender;
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
if(typeof gender == 'undefined' || gender == '' || gender == null){
$.get('http://www.yohobuy.com/index/guide', function(data){
var newMask = document.createElement("div");
newMask.id = 'cover';
newMask.innerHTML=data;
document.body.appendChild(newMask);
var window_height = $(window).height();
var self_height = $('.guide-box').height();
var container_top = window_height / 2 - self_height / 2;
var length=$('.guide-box .clear').find("li").length;
$('.guide-box').css({
width: (200 * length) + 'px',
top: container_top + 'px'
});
$('#cover').bind('click', function(event){
setCookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
closeCover();
});
$('#cover .guide-box .close').bind('click', function(event){
getSource('弹窗','CLOSE','homepage_man');
setCookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
analy('guide_close');
closeCover();
});
$('.boys img , .boys .go').bind('click', function(event){
getSource('弹窗','BOYS','homepage_man');
setCookie('_Gender','1,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','boys',{path : '/',domain : '.yohobuy.com',expires : 7});
analy( 'guide_boys');
closeCover();
});
$('.girls img, .girls .go').bind('click', function(event){
getSource('弹窗','GIRLS','homepage_woman');
setCookie('_Gender','2,3',{path : '/',domain : '.yohobuy.com',expires : 90});
setCookie('_Channel','girls',{path : '/',domain : '.yohobuy.com',expires : 7});
analy( 'guide_girls');
});
$('.lifestyle img, .lifestyle .go').bind('click', function(event){
setCookie('_Channel','lifestyle',{path : '/',domain : '.yohobuy.com',expires : 7});
getSource('弹窗','LIEFSTYLE','homepage_lifestyle');
analy( 'guide_lifestyle');
});
//防止冒泡事件
$('#cover .guide-box').bind('click', function(event){
event.stopPropagation();
});
});
}
}
/**
* 查询跳转后保留关键字
* @return {[type]} [description]
... ... @@ -1200,7 +1267,7 @@ function actionExeTemplate() {
* @return {[type]} [description]
*/
function actionSearch() {
var searchDomain = 'http://search.yohobuy.com/product/search/suggest';
var searchDomain = 'http://search.yohobuy.com/api/suggest';
$('#query_key').search(searchDomain);
}
... ... @@ -1374,6 +1441,7 @@ function init() {
actionListenDelCarGoods(); //监听购物车删除
actionListenCartMore(); //
actionLoginInfo(); //获取登录信息
actionCover(); //初次登录弹框
}
init();
... ...
... ... @@ -670,6 +670,11 @@
top: 22px;
left: 44.2%;
position: absolute;
.main-link {
display: block;
width: 100%;
height: 100%;
}
}
.search {
... ... @@ -1164,6 +1169,11 @@
}
.icon-logo {
left: 39.2%;
.main-link {
display: block;
width: 100%;
height: 100%;
}
}
.sub-nav-list {
width: 990px;
... ... @@ -1215,4 +1225,233 @@
}
}
}
#cover {
left: 0px;
top: 0px;
width: 100%;
height: 100%;
position: fixed;
z-index: 1001;
}
#cover .con {
background: rgba(0, 0, 0, 0.6) !important;
left: 0px;
top: 0px;
width: 100%;
height: 100%;
position: absolute;
z-index: 1002;
opacity: 0.5;
-moz-opacity: 0.5;
}
#cover .tag_img_warpper {
margin: 0px auto;
width: 180px;
height: 168px;
}
#cover .tag_img_warpper img {
width: 100%;
height: 100%;
}
#cover .guide-box {
background: rgb(255, 255, 255);
margin: 0px auto;
height: 400px;
position: relative;
z-index: 1003;
}
#cover .guide-box .close {
top: -15px;
text-align: center;
right: -15px;
color: rgb(255, 255, 255);
line-height: 22px;
font-size: 24px;
position: absolute;
}
#cover .guide-box .close {
background: rgb(0, 0, 0);
border-radius: 50px;
border: currentColor;
border-image: none;
width: 28px;
height: 28px;
line-height: 25px;
display: block;
-moz-border-radius: 50px;
-webkit-border-radius: 50px;
}
#cover .guide-box ul li {
padding: 10px;
width: 200px;
height: 400px;
float: left;
box-sizing: border-box;
}
#cover .guide-box ul li.girls {
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-style: solid;
}
#cover .guide-box ul li.lifestyle {
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-style: solid;
}
#cover .guide-box ul li.kids {
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-style: solid;
}
#cover .guide-box ul li.boys .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li.girls .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li.kids .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li.lifestyle .goods-num {
text-align: center;
color: rgb(187, 187, 187);
line-height: 12px;
font-size: 12px;
margin-top: 16px;
}
#cover .guide-box ul li a.go {
margin: 26px auto 0px;
width: 100%;
height: 18px;
text-align: center;
color: rgb(176, 176, 176);
line-height: 18px;
font-size: 18px;
font-style: italic;
font-weight: lighter;
display: block;
}
#cover .boys .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .girls .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .kids .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .lifestyle .block_cn {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 30px;
}
#cover .boys .block_cn {
color: black;
}
#cover .boys .block_en {
color: black;
}
#cover .girls .block_cn {
color: rgb(255, 136, 174);
}
#cover .girls .block_en {
color: rgb(255, 136, 174);
}
#cover .kids .block_cn {
color: rgb(122, 217, 248);
}
#cover .kids .block_en {
color: rgb(122, 217, 248);
}
#cover .lifestyle .block_cn {
color: rgb(79, 64, 55) !important;
}
#cover .lifestyle .block_en {
color: rgb(79, 64, 55) !important;
}
#cover .boys .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .girls .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .kids .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .lifestyle .block_en {
text-align: center;
line-height: 26px;
font-size: 26px;
font-weight: bold;
margin-top: 19px;
}
#cover .boys .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
#cover .girls .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
#cover .kids .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
#cover .lifestyle .block_line {
margin: 20px auto 0px;
width: 50px;
height: 0px;
border-bottom-color: rgb(204, 204, 204);
border-bottom-width: 1px;
border-bottom-style: solid;
}
... ...