Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用jquery cycle for Photo Slideshow从自动旋转中旋转图像_Php_Jquery - Fatal编程技术网

Php 使用jquery cycle for Photo Slideshow从自动旋转中旋转图像

Php 使用jquery cycle for Photo Slideshow从自动旋转中旋转图像,php,jquery,Php,Jquery,我正在使用我找到的一些幻灯片代码。我跑了起来,把照片展示得很好。我正在播放幻灯片的电视已旋转90度。但这只是身体上的改变。它没有在操作系统中打开。所以我需要将所有图像旋转90度 我似乎无法正确使用代码来翻转它。我尝试过PHP,但我有限的知识使我无法正确使用它 这是我正在使用的代码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1

我正在使用我找到的一些幻灯片代码。我跑了起来,把照片展示得很好。我正在播放幻灯片的电视已旋转90度。但这只是身体上的改变。它没有在操作系统中打开。所以我需要将所有图像旋转90度

我似乎无法正确使用代码来翻转它。我尝试过PHP,但我有限的知识使我无法正确使用它

这是我正在使用的代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Slideshow</title><!-- -->

<script src="scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="scripts/jquery.cycle.lite.js" type="text/javascript"></script>
<script type="text/javascript">

$(document).ready(function(){
    $('#myslides').cycle({
        fit: 1, pause: 1, timeout: 4000
    });
});
</script>
<link rel="stylesheet" href="styles/dynamicslides.css" type="text/css" media="screen" />
</head>
<body>
<?php
$directory = 'images/slideshow';    
try {       
    // Styling for images   
    echo '<div id="myslides">'; 
    foreach ( new DirectoryIterator($directory) as $item ) {            
        if ($item->isFile()) {
            $path = $directory . '/' . $item;

            echo '<img src="' . $path . '"/>';  
        }
    }   
    echo '</div>';
}   
catch(Exception $e) {
    echo 'No images found for this slideshow.<br />';   
}
?>
</body>
</html>

幻灯片
$(文档).ready(函数(){
$('#myslides')。循环({
拟合:1,暂停:1,超时:4000
});
});
有多种类型的“旋转”,但我认为你想要的只是“以90度角旋转图像”

在这种情况下,我建议使用CSS而不是PHP。确保旋转不会截断任何图像

#90Image
{
    /* Firefox */
    -moz-transform:rotate(90deg);
    /* Safari and Chrome */
    -webkit-transform:rotate(90deg);
    /* Opera */
    -o-transform:rotate(90deg);
    /* IE9 */
    -ms-transform:rotate(90deg);
}
并将代码修改为:

echo '<img id="90Image" src="' . $path . '"/>';  
echo';

由于某种原因,这不起作用。但我能够调整到只IMG并删除ID。因为我在整个页面上只做了一个图像,所以它工作正常。