l');
if(typeid==0 || typeid==8){
var url = SITEURL+'search/cloudsearch?keyword='+encodeURIComponent(keyword)+"&typeid="+typeid;
}else{
var url = "http://haihangleyouguolv.cn"+durl+'all?keyword='+encodeURIComponent(keyword);
}
location.href = url;
})
//search focus
var topSearch={};
topSearch.placeholder=$('#st-top-search').attr('placeholder');
topSearch.spanHtml=$('#dt-top-search-span').html();
$('#st-top-search').focus(function(){
$('#st-top-search').attr('placeholder','');
$('#dt-top-search-span').html('');
$(this).keyup(function(event){
if(event.keyCode ==13){
$('.st-btn').click();
}
});
});
$('#st-top-search').blur(function(){
if($(this).val()==''){
$('#st-top-search').attr('placeholder',topSearch.placeholder);
$('#dt-top-search-span').html(topSearch.spanHtml);
}
});
//导航的选中状态
$(".st-menu a").each(function(){
var url= window.location.href;
url=url.replace('index.php','');
url=url.replace('index.html','');
var ulink=$(this).attr("href");
if(url==ulink)
{
$(this).parents("li:first").addClass('active');
}
})
//主导航二级导航
var offsetLeft = new Array();
var windowWidth = $(window).width();
function get_width() {
//设置"down-nav"宽度为浏览器宽度
$(".down-nav").width($(window).width());
$(".st-menu li").hover(function() {
var liWidth = $(this).width() / 2;
$(this).addClass("this-hover");
offsetLeft = $(this).offset().left;
//获取当前选中li下的sub-list宽度
var sub_list_width = $(this).children(".down-nav").children(".sub-list").width();
$(this).children(".down-nav").children(".sub-list").css("width", sub_list_width);
$(this).children(".down-nav").css("left", -offsetLeft);
$(this).children(".down-nav").children(".sub-list").css("left", offsetLeft - sub_list_width / 2 + liWidth);
var offsetRight = windowWidth - offsetLeft;
var side_width = (windowWidth - 1200) / 2;
if(sub_list_width > offsetRight) {
$(this).children(".down-nav").children(".sub-list").css({
"left": offsetLeft - sub_list_width / 2 + liWidth,
"right": side_width,
"width": "auto"
});
}
if(side_width > offsetLeft - sub_list_width / 2 + liWidth) {
$(this).children(".down-nav").children(".sub-list").css({
"left": side_width,
"right": side_width,
"width": "auto"
});
}
}, function() {
$(this).removeClass("this-hover");
});
};
get_width();
$(window).resize(function() {
get_width();
});
})
- 阳光价格明码实价
- 阳光行程品质护航
- 阳光服务专属客服
- 产品丰富一站式服务