如何在bootstrap中使用图像滑块或Carousel插件显示图像

时间:2016-10-01 19:49:26

标签: php twitter-bootstrap

我正在为我当前的网络项目使用bootstrap 我想显示滑块中的所有图像,如The Carousel Plugin,所以我可以移动到下一张图片或之前的图片,如图片滑块plz帮助     我的第一页     //photos.html       

   <iframe class="embed-responsive-item" src="terr.php">

  now my 2nd page 
  //terr.php

   <!DOCTYPE html>
   <html>
    <Head> 
    <title>image upload</title>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1">

     <title>Terror Combat Social Network</title>

    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap1.css" rel="stylesheet">

   <!-- Custom styles for this template -->
    <link href="css/style.css" rel="stylesheet">
   <link href="css/font-awesome.css" rel="stylesheet"
  </head>
  <body>
  <?php
      if(isset($_POST['upload_image'])){

        $file_name = $_FILES['image']['name'];
       $file_type = $_FILES['image']['type'];        
       $file_size = $_FILES['image']['size'];
       $file_tmp_name = $_FILES['image']['tmp_name'];

        if(move_uploaded_file($file_tmp_name,"img/$file_name"));
         echo "succesfull";
      }

     ?>
   <div class="container">

  <label> UPLOAD IMAGE</label>
  <div class="panel panel-default">
       <div class="panel-heading"><strong>Upload Files</strong> <small>upload          any file</small></div>
   <div class="panel-body">
     <h4>Select files from your computer</h4>
     <form action="" method="post" enctype="multipart/form-data" >
   <div class="form-inline">
          <div class="form-group">
        <input type="file" name="image">
     </div>

       <input type="submit"  class="btn btn-sm btn-primary" value="upload     image"            name="upload image">
      </div>
     </form>

      </div>
    <?php 



     $folder = "img/";
      if(is_dir($folder)){
      if($handle = opendir($folder)){

      while(($file=readdir($handle)) !=false){
     if($file=='.' || $file=='..') continue;
    echo '<img src="img/'.$file. '" width="1280" height="720" alt="">';

      echo $file. "<br>";
      }
      closedir($handle);
      }
      }

    ?>


  </body>
 </html>

 images are showing but i want to show like image slider how can i do it

0 个答案:

没有答案