如何改变掩模的礼服,当点击礼服时应该应用到掩模上

How can change the dress of the masque when click on the dress it should be applied to the masque

本文关键字:应用 何改变 改变      更新时间:2023-09-26
    $("#tail").kendoFlatColorPicker({
        preview: false,
        value: "#000",
        change: select
    });
    $("#head").kendoFlatColorPicker({
        preview: false,
        value: "#e15613",
        change: select
    });

我使用颜色选择器尝试了这个代码,请帮助我改变服装

我想我的网站看起来像下面的链接,请看到它并帮助我http://glamstorm.com/en/fittingroom/clothes

兄弟,而不是点击使用悬停看起来很棒,不同于其他网站,这样做是非常简单的。给你的图像一个id,这样他们就可以被唯一地识别。在鼠标悬停函数中,要么传递当前图像的id并将其映射到另一个图像,要么直接传递要交换的图像的id。

<img src="one.jpg" id="one" onmouseover="swapImage('two')">
<img src="two.jpg" id="two" onmouseover="swapMappedImage(this.id)">

所以当一个图像悬停时另一个图像被改变。

点击

如果你想在你的图像上触发事件,设置这个属性,为每一个:

<image src=".." onclick="changeMainImage('put here the path of you main image');" >

,那么你可以把这个函数放在一个脚本标签上:

<script type="text/javascript">
    function changeMainImage(url)
    {
          /*now here you have to get the element of you main top image, supposing that you are usins as an id "myMainImage" ok!
           */
          var mainImage = document.getElementById('myMainImage');
          // here we are setting to the maing image the path you receive as a param
           mainImage.src = url;
    }
</script>