Not sure how to explain this, but here goes:
Instead of Fancybox opening a 'box' on the page which can have a scroll bar inside it to view overflow content, I want the content to just sit on top of the current / parent content.
So, at the moment, if the browser inner width was 800px and you were opening content that needed 1200px height, then the Fancybox 'box' height can be set at 800px and a scrollbar is used to scroll the content of the new 'box' (as the content is 1200px). I want to do it so there is no new scrollbar, but the new content is the full 1200px which pushes the main/parent page down (forcing a scroll bar on the parent if none already existed).
Clicking the close button would still close it.
Is this possible? Do I make sense?
This is for FancyBox 2.
So for this html
use this script
NOTES: You cannot set specific dimensions to images, they will be either full size (when
fitToView
is set tofalse
) or scaled to the viewport (whenfitToView
is set totrue
); the other types of content can be adjusted to the dimensions ofwidth
andheight
as in the code above.TIP : you may open different type of content (or target different contents) with different heights each and change the
height
of fancybox dynamically using the HTML5data-*
attribute .... so for this html:then add the callback
beforeShow
to your script to get the value ofdata-height
like this