Announcement

Collapse
No announcement yet.

Hiding and showing div container/element in Dragdealer prevents slider from working

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hiding and showing div container/element in Dragdealer prevents slider from working

    If you need to hide a slider and display it later on, you'll come across a problem which makes it seem like there is something wrong with your JavaScript code. If you are using Firefox or Chrome and open the Developer Tools, you'll notice your slider mysteriously starts working (in fact, the same applies if you resize your browser window - I assume the slider recalculates its bounds when this event is fired).

    The problem is caused by the Dragdealer needing to recalculate and detect the correct bounds after it is made visible. To do this, in your JavaScript code, use the reflow() method in the section of your code where you make the slider visible.

    Here is an example:

    Code:
    slider.reflow(); // 'slider', in this example, is the Dragdealer instance
    Hope this helps.
Working...
X