I want to set 2 height and width for fancybox 1 is for forms in 'iframe' another is for inline content. Currently I am doing it with the below script. It works but I am wondering if there is a shorter/simpler way to do it.

Code:
$(".fancybox").fancybox({
fitToView: false,
afterLoad: function () {
    if (this.type == "iframe") {
        this.width = this.element.data("width");
        this.height = this.element.data("height");
    };
    if (this.type == "inline") {
        this.width = this.element.data("width");
        this.height = this.element.data("height");
    };}});