// JavaScript Document (function() { var onService_panel = $("#onService_panel"); onService_panel.on({ mouseenter : function(){ onService_panel.animate({ right: 0 }); $(this).hide(); } },"#onlineOpen"); onService_panel.on({ click : function(){ onService_panel.animate({ right: -102 }); onService_panel.find(".online_tab").fadeOut(100); onService_panel.find("#onlineOpen").show(); } },"#onlineClose"); onService_panel.on({ click : function(){ onService_panel.find('.online_tab').fadeOut(100); var that = $(this), onclickId = that.attr("id"), findparent_tab, tops = that.offset().top - (that.height()/2) - 14 - $('body').scrollTop(); switch (onclickId) { case "online_tel_icon": findparent_tab = $("#onlineTelTab"); break; case "online_qq_icon": findparent_tab = $("#onlineQQTab"); break; case "online_message_icon": findparent_tab = $("#onlineMessageTab"); findparent_tab.find('textarea').trigger('blur'); break; } findparent_tab.css({top:tops+'px'}).fadeIn(100); }, mouseenter : function(){ $(this).addClass("online_icon_hover"); }, mouseleave : function(){ $(this).removeClass("online_icon_hover"); } },'.online_icon'); onService_panel.find(".online_tab").on({ click : function(){ $(this).parents(".online_tab").hide(); } },".tab_close"); onService_panel.find("#onlineMessage").on({ keyup : function(){ var t = $(this); if (t.val().length > 100) { t.val(t.val().substring(0, 100)); } var curr = 100 - t.val().length; t.parents("#onlineMessage").find(".text_length b").text(curr.toString()); } },"textarea"); })();