Fancybox runtime height change

For those who use fancy box and iframe inside fancy box might face the issue of changing the height. Once fancybox is loaded with a particular height and width, it does not change when you change the content inside iframe dynamically. Auto height change is only possible for images.

Use the below code to change the dimensions of an iframe in runtime.

<script type=”text/javascript”>

parent.$(“#fancy_outer”).width(100); parent.$(“#fancy_outer”).height(120);

</script>

Cheers

Sajith

11 Comments , , , , ,

11 Responses to “Fancybox runtime height change”

  1. how to get tall November 26, 2009 at 8:37 pm #

    I will post a link to this page on my blog. I am sure my visitors will think of this post very informative.

  2. Hw November 29, 2009 at 11:06 pm #

    Really interesting article to read on.. I�m truly amazed with this article. Looking forward for future posts.

  3. mvp December 9, 2009 at 9:30 am #

    how to use autoheight changes in fancybox in files?

  4. rajasekhar December 29, 2009 at 5:40 pm #

    where to paste the code?

    • Sajith M.R December 30, 2009 at 4:29 pm #

      When you would like to resize the fancy box, use this code. It is upto you

      • Kamlesh Raiya April 13, 2012 at 11:52 am #

        Hi,
        I was trying to change fancy box like textarea.
        i can change height and width from move.

        if you have any idea than let me know, i really need for this in my project.

        Thanks,
        kamlesh

  5. Philipp February 1, 2010 at 5:29 pm #

    Hey Sajith,
    thanks for your work. Would it be possible to see this line of code in action? Maybe an example page or something like that…
    I have to admit, I have no clue how to use this :-/

    Have a nice day
    Philipp

  6. David February 9, 2010 at 4:05 am #

    I love me jqueries. I hugged jqueries at night all over.

  7. Fer February 21, 2010 at 8:12 pm #

    it would be easier to simply use $.fancybox.resize();

  8. Eric January 27, 2011 at 7:47 pm #

    Let’s see this in action? A tutorial is not a tutorial without a demo?!

  9. kris July 6, 2011 at 6:12 pm #

    doesn’t work for me… there’s nothing else to add ?

Leave a Reply

More in php (39 of 104 articles)


I uploaded my first presentation in slideshare. It is about , how the current world's online technical tools can be ...