Auto-play in the Last News section

Support Forums Bogan – HTML template Auto-play in the Last News section

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6410
    Joao Nivaldo
    Participant

    Is it possible to put an auto-play and timeout for the last news & Blog session of home v3? Thanks

    #6411
    CreaboxThemes
    Keymaster

    Yes it’s possible.

    The way is the next:

    1. Add a new data-id to all the elements of the list:

      
      <ul class="selector-posts">
      <li ... data-id="1" ...>
      <li ... data-id="2" ...>
      <li ... data-id="3" ...>
      <li ... data-id="4" ...>
      </ul>
    2. Add the next code in the file “script.js” about the line 436:

      
      setInterval(function() {
                  var id = $(".blog-news-selector .recent-posts ul").find("li.selected").data('id');
                  var n = $(".blog-news-selector .recent-posts ul.selector-posts li").length;
                  console.log("id: " + id + " / n: " + n);
                  if (id == n) {
                      postDetail($(".selector-posts li:eq(0)"));
                  } else {
                      postDetail($(".selector-posts li:eq(" + id + ")"));
                  }
              }, 5000);
      

    Anyway, I have sent you a zip file with the changes in the file “home3.html” and “script.js”.

    Regards

    #6413
    Joao Nivaldo
    Participant

    thanks

    #6415
    CreaboxThemes
    Keymaster

    Your welcome. If you need something more, contact me please.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.