医院网站建设

当前位置: > 医院网站维护 >

商务通底部走马灯效果

发布时间:2019-06-20 作者:医院网站制作 关键词: 商务通走马灯 商务通
现在医疗竞价转化成本比较高,好多医院通常都在商务通里面大做文章,今天给大家奉上用一段自定义的滚动的走马灯效果的滚动文字来替换默认的商务通底部文字(咨询软件由忠仕网站商务通提供)
同样需要在网站服务器上创建一个js文件swt_dhpiao.js

(function(){
var _pathname = window.location.pathname.toLocaleLowerCase(),_ptbool = false,_click="";
if(_pathname.indexOf("minichat_m")>-1){_ptbool=true;}else{_ptbool=false;}
if(_ptbool){_click=" onclick=\"hideme();\""}else{_click=" onClick=\"closeme(1);return false;\""}
    var strVar = "";
        strVar += "<style type=\"text/css\">#mainContent{margin:0 auto 3% auto !important;left:0;top:3.33em!important;bottom:3em!important;overflow-y:visible;overflow-x:hidden;left:0;right:0;width:100%;max-width:640px;}.nk_header{width:100%;background:#0383c2;position:fixed;top:0;z-index:99}.nk_top{max-width:640px;min-width:320px;width:100%;height:auto;overflow:hidden;margin:0 auto;}.nk_top>a{max-width:320px;min-width:160px;width:50%;height:100%;position:absolute;display:block}.nk_top img{max-width:100%;border:0}.nk_top .nk_top_close{width:20px;height:20px;position:absolute;right:0;top:2px;z-index:1001;}.nk_top .nk_top_close::after,.nk_top .nk_top_close::before{content:'';position:absolute;height:1px;width:80%;top:50%;left:10%;background:#e8f4fa}.nk_top .nk_top_close::before{-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-ms-transform:rotate(45deg);-o-transform:rotate(45deg);transform:rotate(45deg)}.nk_top .nk_top_close::after{-webkit-transform:rotate(-45deg);-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);transform:rotate(-45deg)}.swt_righthot{width:65px;position:fixed;right:-50px;top:16%;z-index:9999;-webkit-animation:swing 1s 1s ease both;animation:swing 1s 1s ease both;-webkit-transition:all 1s ease-in-out;transition:all 1s ease-in-out;opacity:0}.swt_righthot.animate{right:0;opacity:1}.swt_righthot.animate1{-webkit-animation:tops 15s infinite;animation:tops 15s infinite}.swt_righthot img{max-width:100%;}@-webkit-keyframes swing{0%{-webkit-transform:translateX(0)}15%{-webkit-transform:translateX(-2%) rotate(-2deg)}30%{-webkit-transform:translateX(2%) rotate(2deg)}45%{-webkit-transform:translateX(-2%) rotate(-2deg)}60%{-webkit-transform:translateX(2%) rotate(2deg)}75%{-webkit-transform:translateX(-2%) rotate(-2deg)}to{-webkit-transform:translateX(0)}}@-webkit-keyframes tops{0%{top:16%}50%{top:50%}to{top:16%}}.animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes fadeInDown{0%{-webkit-transform:translate3d(0,-300%,0);transform:translate3d(0,-300%,0)}50%{-webkit-transform:rotate(3deg);transform:rotate(3deg)}to{-webkit-transform:none;transform:none}}@keyframes fadeInDown{0%{-webkit-transform:translate3d(0,-300%,0);transform:translate3d(0,-300%,0)}50%{-webkit-transform:rotate(3deg);transform:rotate(3deg)}to{-webkit-transform:none;transform:none}}.fadeInDown{-webkit-animation-name:fadeInDown;animation-name:fadeInDown}@-webkit-keyframes fadeOutDown{50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:translate3d(0,300%,0);transform:translate3d(0,300%,0)}}@keyframes fadeOutDown{50%{-webkit-transform:rotate(-5deg);transform:rotate(-5deg)}to{-webkit-transform:translate3d(0,300%,0);transform:translate3d(0,300%,0)}}.fadeOutDown{-webkit-animation-name:fadeOutDown;animation-name:fadeOutDown}@media screen and (max-width:479px) and (min-width:319px){.swt_righthot{width:43px}}.wrapper_foot{position:fixed;bottom:0;left:5%;z-index:1001;overflow:hidden;margin:4px 0;width:90%;background:#fff;white-space:nowrap;font-size:14px;}.inner{overflow:hidden;width:11840px}.inner .txt{display:inline-block}<\/style><div id=\"wrapper_foot\" class=\"wrapper_foot\"><div class=\"inner\"><p class=\"txt\">廊坊市某某医院是廊坊市一家某某专科医院。看病就医认准某某医院,电话15350678651.</p></div></div>\n";
    var o = document.createElement('div');
    o.innerHTML = strVar;
    while(o.firstElementChild){
        document.body.appendChild(o.firstElementChild);
    };   
    var _$ = function(id){return document.getElementById(id);}
 
 
    
    var wrapper = _$('wrapper_foot');
    var inner = wrapper.getElementsByTagName('div')[0];
    var p = inner.getElementsByTagName('p')[0];
    var p_w = p.offsetWidth;
    var wrapper_w = wrapper.offsetWidth;
      function fun(){  
        if(wrapper_w > p_w){ return false;}
        inner.innerHTML+=inner.innerHTML;       
        setTimeout("fun1()",2000);    
      }
    window.fun1 = function (){    
        if(p_w > wrapper.scrollLeft){
          wrapper.scrollLeft++;
          setTimeout("fun1()",30);
        }
        else{
          setTimeout("fun2()",2000);
        }
      }
    window.fun2 = function (){
        wrapper.scrollLeft=0;
        fun1();
      }
      fun();
  })();

再将这个代码嵌入到商务通里即可解决了。
 
责任编辑:医院网站制作
医院网站维护