简体   繁体   中英

How do i make fancybox resize properly in ie

I have a website that displays some partial html content in fancybox.
In all browsers other than IE, i can specify some css to control the height width for some content that is rather large and for most, i default it to 500x500 as that seems to be the standard size. However, in IE, that doesnt work, in fact, nothing works. The content is always as wide as possible and as long as the content is.

The javascript is

$('.fancybox-test').fancybox();

the link html looks like

<a  class="fancybox-test" href="test.htm">load test.htm</a>

and the html displayed is

<section class="lightbox" style="height: 500px; width: 500px;">
    <h1>
        title</h1>
    <p>
        lorem ipsum
    </p>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec fermentum iaculis
        neque in aliquet. Aliquam eleifend mi molestie ligula convallis vel porta ante ultrices.
        Mauris lacus nulla, porta nec pretium sit amet, adipiscing eu orci. Phasellus orci
        lectus, sollicitudin non dapibus et, condimentum tempor purus. Nulla eget eros quis
        felis posuere bibendum. Mauris eget gravida diam. Fusce vitae facilisis nulla. Donec
        quis sagittis nibh. Nam eros nunc, auctor ut molestie non, feugiat sed lorem.
    </p>
    <p>
        Quisque non ante ut mauris rhoncus tincidunt. Donec mollis mauris quis enim molestie
        sed accumsan massa dignissim. Phasellus lacinia volutpat laoreet. Aenean suscipit
        pretium quam, sed blandit purus vestibulum ac. Cras ligula elit, volutpat vel mollis
        eget, ornare a lacus. In ut vehicula felis. Sed tincidunt eleifend nisl, ac imperdiet
        turpis tempor at. Ut pellentesque, felis et porttitor lacinia, urna libero interdum
        nisi, sed consectetur risus massa nec metus. Maecenas nec ligula vel augue laoreet
        venenatis in nec lectus. Mauris ut nisi sit amet turpis auctor rutrum. Nullam non
        congue sapien.
    </p>

</section>

As my comment said, HTML5 support in IE is limited. Open this url up in IE and you'll see whats supported - http://html5test.com/results.html

See that 'Section element' is not supported.

If you're concerned with supporting IE, you may need to revert back to using a standard <div>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM