Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript anythingslider – printing current slide number in html (into a separate div)

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #30890
    jayousama
    Member

    i’m trying to get this:

    “var current = $(‘#slider1’).data(‘AnythingSlider’).currentPage; // returns page #”

    to print out the current slide # into a separate div to let the user know via pure text what slide he/she is on – ie “(1) of 5”, “(2) of 5”, “(3) of 5”, etc; parentheses denoting current slide #

    suggestions?


    also, found this past thread which might or might not be related to a solution:
    https://css-tricks.com/forums/discussion/8187/anything-slider-numbers-to-text/p1

    suggests:
    var nameArray = new Array(“Name 1″,”Name 2″,”Name 3″,”Name 4″,”Name 5″,”Name 6”)function formatText(index, panel){
    var myHtml = “

    My text for Panel #” + index + ” is ” + nameArray[index] + “


    return myHtml;
    }

    i tried placing it in my footer right before the closing body tag:

    but i’m unsure as to where .myDiv gets printed out in html- am i missing something?

Viewing 1 post (of 1 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.