duangaoe9401 2012-11-21 11:51
浏览 64

在网页上组合多个图像,然后单击按钮单独更改它们

I'm an ammature when it comes to webdesigning, I sort of ctrl+c > ctrl+v all of the time trying to learn. At the moment I'm making a webapplication for selecting cushions on a couch. I created a page where you can click on a color to see the cushions in that specific color, but I would like to change the color of the base of the couch also.

In short: I would like to place 2 png images on top of each other and be able to change them individually by clicking on colors.

My code for now:

<body>
<div id="page">
    <div id="gallery">
        <div id="panel"><img id="largeImage" src="images/image_01_large.png"/>

            <div id="thumbs">
                <img src="images/image_01_thumb.png" alt="Lime Green"/>
                <img src="images/image_02_thumb.png" alt="Burgundy"/>
                <img src="images/image_03_thumb.png" alt="Cobalt Blue"/>
            </div>
            <script>
                $('#thumbs').delegate('img', 'click', function () {
                $('#largeImage').attr('src', $(this).attr('src').replace('thumb', 'large'));
                $('#description').html($(this).attr('alt'));
            }); 
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 #MATLAB仿真#车辆换道路径规划
    • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
    • ¥15 数据可视化Python
    • ¥15 要给毕业设计添加扫码登录的功能!!有偿
    • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
    • ¥15 微信公众号自制会员卡没有收款渠道啊
    • ¥100 Jenkins自动化部署—悬赏100元
    • ¥15 关于#python#的问题:求帮写python代码
    • ¥20 MATLAB画图图形出现上下震荡的线条
    • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘