function changeonline(num) { if (isnan(num) && num == "") return; for (var i = 1; i <=6 ; i++) { if (i == num) { document.getelementbyid("onlinesort" + i).classname = "online_bar expand"; document.getelementbyid("onlinetype" + i).style.display = "block"; } else { document.getelementbyid("onlinesort" + i).classname = "online_bar collapse"; document.getelementbyid("onlinetype" + i).style.display = "none"; } } } $(document).ready(function(){ $("#floatshow").bind("click",function(){ $('#onlineservice').animate({width: 'show', opacity: 'show'}, 'normal',function(){ $('#onlineservice').show(); });$('#floatshow').attr('style','display:none');$('#floathide').attr('style','display:block'); return false; }); $("#floathide").bind("click",function(){ $('#onlineservice').animate({width: 'hide', opacity: 'hide'}, 'normal',function(){ $('#onlineservice').hide(); });$('#floatshow').attr('style','display:block');$('#floathide').attr('style','display:none'); }); $(document).bind("click",function(event){ if ($(event.target).ischildof("#online_qq_layer") == false) { $('#onlineservice').animate({width: 'hide', opacity: 'hide'}, 'normal',function(){ $('#onlineservice').hide(); });$('#floatshow').attr('style','display:block');$('#floathide').attr('style','display:none'); } }); jquery.fn.ischildandselfof = function(b){ return (this.closest(b).length > 0); }; jquery.fn.ischildof = function(b){ return (this.parents(b).length > 0); }; //$(window).scroll(function(){ //$('#online_qq_layer').stop().animate({top:$(document).scrolltop() + $("#online_qq_layer").height()}, 100) //}); });