LPAOriginal
LPAOriginal

Reputation: 11

Jquery slider 100% height

I'm trying to set a vertical jquery slider to 100% height of a container div. How can I do this? I've tried changing the parameter height: 400 to height:"100%" but that just stretches the page to the height of the entire slider content. The goal is to have a flexible page with no scroll bars on the side

$(document).ready(function() {
    $('#my-list').hoverscroll();

});

// Override default parameters onload
$.fn.hoverscroll.params = $.extend($.fn.hoverscroll.params, {
    vertical: true,
    width: 221,
    height: 400,
    arrows: false
});

Upvotes: 0

Views: 1051

Answers (1)

Ohgodwhy
Ohgodwhy

Reputation: 50787

There's no need to extend the plugin. Hoverscroll accepts parameters in the form of an object.

$('#my-list').hoverscroll({
  vertical: true,
  width: 221,
  height: $('container-div').height(),
  arrows:false
});

Replace container-div with the element that you wish to reference the height of.

Upvotes: 1

Related Questions