Twitter Bootstrap Collapse plugin Direction—Horizontal instead of Vertical

前端 未结 7 581
孤城傲影
孤城傲影 2020-11-28 07:27

Is there a way to collapse the the Bootstrap Collapse plugin from horizontally instead of vertically? Looking at the code this ability doesn\'t seem to be built in, but I\'m

相关标签:
7条回答
  • 2020-11-28 08:17

    It doesn't appear to be an option for that particular plugin. It looks like you may need to modify it or hook into it somehow to get it to work that way...

    After looking at the JS file for a bit I noticed a couple things. First thing is that it looks like it might be using bootstrap-transition.js ,which appears to be using CSS3 transitions. So it might be possible to write a new transition. I am not 100% certain if that is how it is working though.

    Option One

    My suggestion would be to either poke around in the bootstrap-collapse.js plugin file for a while and see if you can figure out how it is working.

    In particular I would look at this part... bootstrap-carousel.js

    this.$element[dimension](0)
    this.transition('addClass', $.Event('show'), 'shown')
    $.support.transition && this.$element[dimension](this.$element[0][scroll])
    

    It looks like .transition is a callback from bootstrap-transition.js

    Option Two

    My second suggestion would be to just write something of your own.

    My Answer

    And finally my answer is that from looking at the bootstrap documentation it doesn't appear to be an option.

    Some additional info:

    This website seems to be doing similar stuff with CSS3 transitions. http://ricostacruz.com/jquery.transit/

    0 讨论(0)
提交回复
热议问题