【发布时间】:2018-03-14 04:59:52
【问题描述】:
image HTML
我想在悬停在下面的图像时显示上面的图像。但我不知道如何显示它,因为我是角度新手
<div class="col-md-7" ng-controller="slideController">
<div class="text-center">
<?php
$id = $_GET['id'];
$result1 = mysqli_query($db, "SELECT * FROM product_images WHERE product_id ='$id' ");
while($row1 = mysqli_fetch_assoc($result1)) { ?>
<img src="../backend/uploads/<?php echo $row1['image']; ?>" width="200px" height="300px" ng-model="id[<?php echo $row1['id']; ?>]" ng-hide="hideImage">
<?php } ?>
<hr>
<?php
$id = $_GET['id'];
$result1 = mysqli_query($db, "SELECT * FROM product_images WHERE product_id ='$id' ");
while($row1 = mysqli_fetch_assoc($result1)) { ?>
<img src="../backend/uploads/<?php echo $row1['image']; ?>" width="100px" height="100px" ng-mouseover="slideImage(<?php echo $row1['id']; ?>)">
<?php } ?>
</div>
</div>
JS
var slide=angular.module("myApp",[])
slide.controller('slideController', function ($scope) {
$scope.id = {};
$scope.hideImage = true;
console.log($scope.id)
$scope.slideImage = function(id) {
if (id == $scope.id) {
$scope.hideImage = false;
}
}
【问题讨论】:
标签: javascript php jquery angularjs