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

Home Forums JavaScript Javascript Slider Auto Resize

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #35810

    Hey all,

    I’m trying to build a content slider for a client that displays their last four posts. Right now it’s just plain HTML but I’m having a problem.

    The slider box needs to be 180px high with a scrollbar when needed. My slider seems to work except it makes the slide boxes all as tall as the tallest box. That leaves short posts with a ton of blank space under them.

    Anyone know a fix?


    That’s true. I was looking into using that. I wanted the slider to stay the same size and a scrollbar to be added though. I figured out how to do it with this:

    'marginLeft' : slideWidth*(-currentPosition)
    $('#slidesContainer').css('height', $(this).children(".slide:nth-child(" + parseInt((Math.ceil(-1*slideWidth*(-currentPosition) / $("#slideshow").width())) + 1) + ")").height() + "px");

    And by I figured it out I mean someone helped me on Stack Overflow. Just thought I should clarify =)

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