TheWebShop / bootstrap-shortcodes

Wordpress plugin to add shortcodes for Twitter Bootstrap 3.0
36 stars 15 forks source link

Force collapse to open at item heading instead of halfway down item content #67

Open pxmongress opened 8 years ago

pxmongress commented 8 years ago

Collapsible items that contain longer content cause the next opened item to push its item header and description up out of screen view. This requires the user to scroll up to see the item header and beginning of the content for that collapsible item. Native height is maintained, it just opens further down on the description instead of at the beginning. Any suggestions on how to force the item to open at the item header/content start?

Sinetheta commented 8 years ago

Hey @pxmongress can you include some screenshots of the problem? I have a feeling that this is an issue with how Bootstrap behaves on not with how this plugin works, but I'd be happy to offer advice.

pxmongress commented 8 years ago

Thanks for the response! The below is a creen video capture as it shows the behavior better. Shorter items behave fine, but once the item content is too tall, the behavior starts to be noticeable. http://tinypic.com/r/2h3vkep/9 - Collapse Behavior - Screen Capture

Sinetheta commented 8 years ago

Unfortunately this is intended behaviour in both the current Bootstrap 3 (used in this plugin) http://getbootstrap.com/javascript/#collapse and in the upcoming bootstrap 4 http://v4-alpha.getbootstrap.com/components/collapse/

You could change the behaviour by adding some javascript to your site's theme if you wanted. Here's an example where someone scrolls the page to the top of the currently visible accordion header http://stackoverflow.com/a/23417908/848249