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 += '
'; } tmp_str += '
'+$(this).html()+'
'; if(tmp_num%3==0 && tmp_cout != tmp_num){ tmp_str += '
'; } if(tmp_cout == tmp_num) { tmp_str += '
'; } $(this).html(''); }); $('#MiddleContent').append(tmp_str); $(tid).remove() }