-1

我正在为摄影师建立一个网站,我使用 iframe 将不同的图片作为长条图片包含到网站中。这在 chrome safari en firefox 中运行良好,但在 Internet Explorer 中似乎不起作用? 这是我使用 iframe 的文件

<?php
include 'core/init.php';
include 'includes/overall/overalheader.php';
include 'includes/aside.php'; 

if (isset($_GET['id']) === true && empty($_GET['id']) === false) {
    $_SESSION['serie_id'] = $_GET['id'];
    $lengte = lengte_frame($_SESSION['serie_id']);
    ?>
    <iframe src="includes/fotos.php" frameborder="0" height="520px" width="<?php echo $lengte; ?>px"></iframe>
    <?php
}
else {
    echo 'hallee dermee';
}
 include 'includes/overall/overalfooter.php';?> 

这是 fotos.php 文件

<?php
include '../core/init.php';

$tekst = get_tekst($_SESSION['serie_id']);
$fotos = get_fotos($_SESSION['serie_id']);
?>


        <div width="135" style="float:left; padding-left:15; border:1; max-width:200"></div>
        <?php
        $count = 0;
        foreach ($fotos as $foto) {
            if ($count == 0) {
                $breed = 160;
            } else {
                $breed = 15;
            }
            echo '<div style="float:left; padding-left:' . $breed . '" width="' . $foto['width'] . '"><img src="../' . $foto['path'] . '" height="' . $foto['height'] . '" width="' . $foto['width'] . '"></div>';
            $count++;
        }

        if (empty($tekst) === false) {
       echo '<table style="float:left; padding-left:15;" width="200"><tr><td valign="top"><font face="Courier New, Courier, monospace" color="#777777" size="2px">' . $tekst . '</font><td><tr></table>';
        } 

        ?>
4

2 回答 2

0

您正在使用height="520px"一个属性,这是不正确的。大小属性必须始终是单个数字,以像素为单位。
所以正确的做法是height="520"(宽度也是如此)。或者,使用样式。

于 2013-05-11T10:29:22.347 回答
0

问题似乎是您为这些图像的高度设置的。

在其他浏览器中查看源代码,图片(IMG 标签)将高度属性显示为空。在 IE 中,所有图像的高度都显示为 1。

这个 PHP 变量:

$foto['height']

... 存储了一个无效值。

这似乎不是 IFRAME 问题,而是其中的图像。

于 2013-05-11T11:11:40.230 回答