SoFunction
Updated on 2025-02-28

Layer sets maxWidth and maxHeight solutions

layer introduction

layer is a web-based component that has been popular in recent years. It has a comprehensive solution and is committed to serving developers at all levels. Your page will easily have a rich and friendly operating experience. Download and use to visit the official website.

Area attribute

The width and height of the layer are set through the area attribute, for example, area:['300px','600px'], indicating that the width is 300px; the height is 600px pop-up layer;

Default setting: layer width and height are adaptable, that is, the default value of area is ‘auto’.

maxWidth and maxHeight properties

‘maxWidth’ and ‘maxHeight’ correspond to ‘max-width’ and ‘max-height’ in css respectively. If you want to set this property and make it work, you must set the area property to the default setting (area: 'auto').

Sample code

 ({
    type: 1,
    title: 'Attribute Information',     //Popt-up layer title    area: 'auto',      //Adaptive width and height    maxHeight:'600px',    // Maximum height of 600 pixels    shadeClose: true,     //Click the mask to close    content: html       //Popt-up layer content  });

Summarize

The above is the layer setting maxWidth and maxHeight solution introduced to you by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to everyone in time. Thank you very much for your support for my website!
If you think this article is helpful to you, please reprint it. Please indicate the source, thank you!