You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
2.2 KiB
JavaScript

jQuery(function($) {
$(document).ready( function() {
$('#searchCruise').stickUp();
});
});
$(document).ready(function(e) {
//切换游船分类
$('div.Tags ul.CruisesLevel li').each(function(index, element) {
var _tid = $(this).attr('tdata');
if(_tid != 'undefined'){
cruisetage('.'+_tid)
}
});
$('.pLuxury').show();
$('.soredata').remove();
allship = Array();
$('.ShipsDetail').each(function(index, element) {
var o = this;
var shipname = $(this).children('.ShipImage').children('ul.ShipDetails').children('li.Name').html();
var _ship = shipname.replace(/ /g,'-').toLowerCase();
allship.push(shipname);
$(this).children('.Price').children('span.number').attr('id',_ship)
});
$.ajax({
url:'/api/api.php',
type:'POST',
data:{method:'cruisegetprice',sn:allship.join(',')},
success: function(obj){
for(var key in obj){
//console.log(key);
$('#'+key).html('$'+obj[key]);
}
}
});
$('.CruisesLevel li:not(:last-child)').click(function(){
$('.CruisesLevel li').removeClass('cactive');
$(this).addClass('cactive')
var slevel = 'p'+$(this).attr('tdata');
$('.AllShips').hide();
$('.'+slevel).show();
var scrollValue=$(window).scrollTop()+2;
$("html,body").animate({scrollTop:scrollValue},20);
});
$('#featured').orbit({animation: 'fade', bullets: true, 'bulletThumbs': false, captions: true, afterSlideChange: function(){}});
$(".advertising-container").mouseover(function(){
$(".slider-nav .right,.slider-nav .left").show();
});
$(".advertising-container").mouseout(function(){
$(".slider-nav .right,.slider-nav .left").hide();
});
});
function cruisetage(tid){
var tmp_str = '';
var tmp_num = 0;
var tmp_cout=$(tid).length;
$(tid).each(function(index, element) {
tmp_num += 1;
if(tmp_num==1){
tmp_str += '<div class="AllShips p'+tid.replace('.','')+'">';
}
tmp_str += '<div class="ShipsDetail t'+tid.replace('.','')+'">'+$(this).html()+'</div>';
if(tmp_num%3==0 && tmp_cout != tmp_num){
tmp_str += '</div><div class="AllShips p'+tid.replace('.','')+'">';
}
if(tmp_cout == tmp_num)
{
tmp_str += '</div>';
}
$(this).html('');
});
$('#MiddleContent').append(tmp_str);
$(tid).remove()
}