Forums

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

Home Forums JavaScript Moving Boxes slider – start at ‘middle’ ?

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #30807
    norcross
    Member

    I’ve correctly integrated the moving boxes script into a WordPress site I’m developing fora client. The issue I’m running into is that the images will each link to a custom post type, and I don’t know how many there will be. Is there a way to have it start at the middle (i.e. if there are 5 posts, start at #3, if there are 15, start at #7, etc). ?

    #65622
    dhechler
    Member

    Seems like you would just make a counter. Not sure the exact code, but something like
    i = 1
    foreach (slider box) {
    I++;
    }

    then divide by half of the last counted number and round to the nearest number.

    Sorry if this doesnt help much. Just getting an idea started.

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