【问题标题】:Changes set of images on click - Fotorama单击时更改图像集 - Fotorama
【发布时间】:2013-09-29 12:47:57
【问题描述】:

当我点击一个 div 时,有没有办法改变 Fotorama 中的图像?

例如,我有两个 div,一个名为#NYPhotos,另一个名为#WAPhotos。当我点击 div #NYPhotos 时,Fotorama 会出现在它的下方,显示我在纽约拍摄的照片。之后,当我点击#WAPhotos 时,fotorama 中的图像会换成华盛顿的照片。

我能够让 Fotorama 与纽约的照片一起出现,但尝试交换图像时没有运气......有什么想法吗?

【问题讨论】:

    标签: javascript jquery html css fotorama


    【解决方案1】:

    首先,我建议阅读这个问题的答案,这应该会有所帮助:How to change an image on click using CSS alone?

    如果您不想阅读,那么基本上主要思想是:

    input[type="checkbox"]:before {
         content: url('images/icon.png');
         display: block;
         width: 100px;
         height: 100px;
    }
    input[type="checkbox"]:checked:before {
    content: url('images/another-icon.png');
    }
    

    只需使用 CSS 将每个部分设为 div。希望这有帮助!

    【讨论】:

      猜你喜欢
      • 2013-05-13
      • 1970-01-01
      • 1970-01-01
      • 2013-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-21
      相关资源
      最近更新 更多