WordPress.org

Ready to get started?Download WordPress

Forums

Easy FancyBox
[resolved] Changing Width of Modal Window (3 posts)

  1. Brad Ruggles
    Member
    Posted 3 years ago #

    I just upgraded to the latest version of your plugin and love the added configuration options!!

    Since upgrading, my inline modal window is displaying different than it was. It was displaying in a fixed window size but now it is showing up at 90% width. I'd like to specify the width of the inline modal window like I can with the other media types. How can I do that?

    Here is the code I'm using to call up the inline modal window:

    <a id="inline" class="fancybox" href="#data">Link Title</a>
    
    <div style="display: none; width: 400px;">
    <div id="data">Inline modal window content displayed here</div>
    </div>

    http://wordpress.org/extend/plugins/easy-fancybox/

  2. RavanH
    Member
    Plugin Author

    Posted 3 years ago #

    FancyBox (attached to class "fancybox") automatically detects the content size and adjusts the overlay window size to it, with a maximum of 90% of the viewport size... In your case, the content seems to get stretched to that maximum because FancyBox cannot find any fixed size for it.

    I did some testing and if you give the div#data a width and height, it should work just fine. Something like:

    <a id="inline" class="fancybox" href="#data">Link Title</a>
    <div style="display:none">
    <div id="data" style="height:300px;width:400px;">Inline content...</div>
    </div>
  3. Brad Ruggles
    Member
    Posted 3 years ago #

    Bingo! That did the trick! Thanks for the tip!!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic