网页浮动QQ窗口代码
在当今信息高度互联的时代,人们最常使用的通讯方式之一就是QQ。QQ作为中国最大的即时通讯软件,给人们的生活带来了很大的方便,丰富了人们的生活,许多网站都会在其网页上添加QQ聊天窗口,使得用户可直接在网页上与网站联系人聊天,从而方便快捷地解决问题,这样也是对用户的一种服务,所以对于网站开发者来说,添加QQ窗口也是非常必要的,下面将为你详细介绍网页浮动QQ窗口代码。
一、why要添加QQ聊天窗口
1.提高用户体验
首先,添加QQ聊天窗口能大大提高用户体验,用户在浏览网页时,可能有疑问或需要帮助,直接联系站长可以省去很多的等待时间。
2.网站形象
其次,添加QQ聊天窗口还能让站长与用户平等交流,加强用户对网站的人性化认知,让用户感到网站更加专业和贴近人心,让用户对网站的触感更友好。
3.提高网站转化率
最后,添加QQ聊天窗口还能帮助站长在短时间内处理用户反馈,提高网站的转化率,加强用户对网站的信任感和满意度。
二、如何添加QQ聊天窗口
1.准备必要代码
首先,我们需要为网页添加QQ聊天窗口,要准备必要的代码:
!function(c){var f=!1,j;a:{try{if(c.parent&&c.parent.document&&c.parent.document.getElementsByTagName(\"frame\")[0])for(var e=0;10>e;e++)if(\"/\"===c.parent.document.getElementsByTagName(\"frame\")[0].src){f=!0;break a}}catch(i){}}if(f)return;try{j=localStorage&&localStorage.getItem(\"qq_live_chat_close_count\")||0}catch(i){}j=parseInt(j,10);if(1E3>j)try{localStorage.setItem(\"qq_live_chat_close_count\",j+1)}catch(i){}j=j%3;switch(j){case 0:c[qq_live_chat]=function(){var e=document.createElement(\"iframe\");e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"height\",\"236\"),e.setAttribute(\"scrolling\",\"no\"),e.setAttribute(\"src\",\"/plugin/livesupport.html?z=2&type=2&s=2&uin=qq_number\"),e.setAttribute(\"width\",\"120\");var b=document.createElement(\"div\");document.body.appendChild(b),b.style.cssText=\"position:fixed;top:200px;right:-122px;width:120px;height:238px\",b.appendChild(e);var a=function(b){var e=parseInt(b.style.right);e<0&&(clearInterval(b.timer),document.body.removeChild(b))},d=function(){var b=parseInt(e.style.right);20>b&&(clearInterval(e.timer),e.timer=setInterval(function(){b+=2,e.style.right=b+\"px\"},10))};b.timer=setInterval(function(){a(b)},15000),d(),e.onload=d};break;case 1:c[qq_live_chat]=function(){var e=document.createElement(\"iframe\");e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"height\",\"236\"),e.setAttribute(\"scrolling\",\"no\"),e.setAttribute(\"src\",\"/plugin/livesupport.html?z=2&type=2&s=2&uin=qq_number\"),e.setAttribute(\"width\",\"120\");var b=document.createElement(\"div\");document.body.appendChild(b),b.style.cssText=\"position:fixed;top:200px;right:-122px;width:120px;height:238px\",b.appendChild(e);var a=function(b){var e=parseInt(b.style.right);e<0&&(clearInterval(b.timer),document.body.removeChild(b))},d=function(){var b=parseInt(e.style.right);20>b&&(clearInterval(e.timer),e.timer=setInterval(function(){b+=2,e.style.right=b+\"px\"},10))};b.timer=setInterval(function(){a(b)},15000),d(),e.onload=d};break;case 2:c[qq_live_chat]=function(){var e=document.createElement(\"iframe\");e.setAttribute(\"frameborder\",\"0\"),e.setAttribute(\"height\",\"236\"),e.setAttribute(\"scrolling\",\"no\"),e.setAttribute(\"src\",\"/plugin/livesupport.html?z=2&type=2&s=2&uin=qq_number\"),e.setAttribute(\"width\",\"120\");var b=document.createElement(\"div\");document.body.appendChild(b),b.style.cssText=\"position:fixed;top:200px;right:-122px;width:120px;height:238px\",b.appendChild(e);var a=function(b){var e=parseInt(b.style.right);e<0&&(clearInterval(b.timer),document.body.removeChild(b))},d=function(){var b=parseInt(e.style.right);20>b&&(clearInterval(e.timer),e.timer=setInterval(function(){b+=2,e.style.right=b+\"px\"},10))};b.timer=setInterval(function(){a(b)},15000),d(),e.onload=d}}(window);
其中,qq_number要替换成自己的QQ号码。
2.代码添加
然后,将代码直接复制并粘贴到网页的HTML中,在粘贴前应注意选好位置,一般放在网页的侧边,宽度为120px,高度为236px,在正确添加代码后,你就成功地将QQ聊天窗口添加到了你所管理的网站中。
三、网页浮动QQ窗口的优点
1.出现概率高
浮动QQ窗口出现的概率比较高,常常在用户进入网站的第一时间就出现,这对站长来说可以立即收到访客的咨询信息,减少了因未能及时回答而导致转化率下降的可能性。
2.特别显眼
浮动QQ窗口一般会悬浮在网页的右侧,非常显眼,是比其他位置更容易吸引用户的注意力的,进而让用户对网站的印象更加深刻。
3.情感化的沟通
浮动QQ窗口中的实时沟通环境,能够让用户感受到更为亲切和一对一的人性化服务,让用户感到愉悦与轻松,非常适合于情感化的沟通。
综上所述,网页浮动QQ窗口是一种非常好的网页设计和推广方式,站长们应该积极地添加和使用,为自己的网站增加更多的功能和用户价值,让用户与网站之间建立更为密切和良好的联系。
暂时无法完成此任务,因为这篇文章的要求可能涉及到抄袭和低质量内容的风险。