• Resolved esdras007

    (@esdras007)


    Your plugin is amazing! Congratulations!

    Could you teach me how to set the local time?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Benaceur

    (@benaceur)

    Settings -> General : Timezone

    Thread Starter esdras007

    (@esdras007)

    Forgive me, I didn’t ask the question correctly.

    I used the script below, in “Customization or adding script (java / jquery)” in the plugin. See the script:

    <script src=”https://code.jquery.com/jquery-1.11.2.js”></script&gt;
    <script type=”text/javascript”>
    jQuery(window).load(function($){
    atualizaRelogio();
    });
    </script>
    <BODY>
    <div><output id=”hora”></output></div>
    </BODY>
    <script>
    function atualizaRelogio(){
    var momentoAtual = new Date();

    var vhora = momentoAtual.getHours();
    var vminuto = momentoAtual.getMinutes();
    var vsegundo = momentoAtual.getSeconds();

    if (vhora < 10){ vhora = “0” + vhora;}
    if (vminuto < 10){ vminuto = “0” + vminuto;}
    if (vsegundo < 10){ vsegundo = “0” + vsegundo;}

    horaFormat = vhora + “:” + vminuto + “:” + vsegundo;

    document.getElementById(“hora”).innerHTML = horaFormat;

    setTimeout(“atualizaRelogio()”,1000);
    }
    </script>

    And in “Type your news (manually) here:” or in
    “The title ltr” I used the id:

    <div><output id=”hora”></output></div>

    Then the clock appeared in the same title on its website.

    But how do you make the clock blink with another word, just like in your website example?

    https://benaceur-php.com/

    Thanks!

    Plugin Author Benaceur

    (@benaceur)

    code html:

           <span>
    <ul id="timeText_b-barBottom-comm">
      <li>
    	   yourText
      </li>
      <li>
           <span id="dateDiv_b-bar-bottom"></span>
      </li>
      
    </ul>
    	   </span>

    code java:

    function showTimeBennnBar()
    {
    	var now = new Date();
    	
    	thour=now.getHours();
    	tmin=now.getMinutes();
    	tsec=now.getSeconds();
    	
    	if (tmin<=9) { tmin="0"+tmin; }
    	if (tsec<=9) { tsec="0"+tsec; }
    	if (thour<10) { thour="0"+thour; }
    	
    	today =  thour + ":" + tmin +":"+ tsec;
    	document.getElementById("dateDiv_b-bar-bottom").innerHTML = today;
    }
    setInterval("showTimeBennnBar()", 0);
    
    !function(a){a.textRotator_ben_timeText=function(b,c){var d={random:!1,fadeIn:1e3,fadeOut:500,duration:3e3,easingin:"swing",easingout:"swing"},e=this;e.settings={},e.globals={child_select:1,$child_select:null};var f=a(b),b=b;e.init=function(){e.settings=a.extend({},d,c),e.settings.random&&e._shuffle(f.children()),e.globals.$child_select=f.find("li:nth-child("+e.globals.child_select+")"),e._fadeIn()},e._fadeIn=function(){e.globals.$child_select.fadeIn({duration:e.settings.fadeIn,easing:e.globals.$child_select.data("easingin")?e.globals.$child_select.data("easingin"):e.settings.easingin,complete:function(){f.find("li").length>1&&e._fadeOut()}})},e._shuffle=function(b){var c=b.get(),d=function(a){return Math.floor(Math.random()*a)},e=a.map(c,function(){var b=d(c.length),e=a(c[b]).clone(!0)[0];return c.splice(b,1),e});b.each(function(b){a(this).replaceWith(a(e[b]))})},e._fadeOut=function(){var a=e.globals.$child_select.data("duration")?e.globals.$child_select.data("duration"):e.settings.duration;e.globals.$child_select.delay(a).fadeOut({duration:e.settings.fadeOut,easing:e.globals.$child_select.data("easingout")?e.globals.$child_select.data("easingout"):e.settings.easingout,complete:function(){e.globals.$child_select.index()+1==f.children().length?(console.log("last"),e.globals.$child_select=f.children().first()):e.globals.$child_select=e.globals.$child_select.next("li"),e._fadeIn()}})},e.init()},a.fn.textRotator_ben_timeText=function(b){return this.each(function(){if(void 0==a(this).data("textRotator_ben_timeText")){var c=new a.textRotator_ben_timeText(this,b);a(this).data("textRotator_ben_timeText",c)}})}}(jQuery);
    !function(a){a("#timeText_b-barBottom-comm").textRotator_ben_timeText({random:!1,fadeIn:1e3,fadeOut:500,duration:4e3,easingin:"swing",easingout:"swing",debug:!1})}(jQuery);
    Thread Starter esdras007

    (@esdras007)

    Thanks!
    I just didn’t understand where I can put the html code. Could you help me please?

    Thread Starter esdras007

    (@esdras007)

    Excuse me!
    I got it! Thanks! It was excellent!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to insert time?’ is closed to new replies.