0

I have the following code fragment in Javascript:

slider.viewport.height(getViewportHeight())

It resizes the height of a slider. I would like to resize to stay with 100px unless in bottom. I've tried using something like:

slider.viewport.height(getViewportHeight()-100px);

But it doesn't work.

What I need is that the slider to resize and occupies only a fixed height of the viewport with a spare in the bottom.

sergdenisov
  • 8,327
  • 9
  • 48
  • 63

1 Answers1

0

If the getViewportHeight() works.. then you just have to remove the px measures. After the math operation is completed, you add it.

slider.viewport.height((getViewportHeight()-100) + 'px');

In case your getViewportHeight() doesn't work, here you have some good ways to get your viewport height: Get the browser viewport dimensions with JavaScript

Community
  • 1
  • 1
Ariel
  • 1,507
  • 2
  • 20
  • 28