Adding Instagram filters on images in my website

前端 未结 4 1274
無奈伤痛
無奈伤痛 2021-01-24 09:16

I am using CSSGram on my website to make images have Instagram-like filters. This is the method below to add a filter to a image:

 
4条回答
  •  深忆病人
    2021-01-24 09:58

    with JQUERY:

    use addClass method

    $('figure').addClass('aden')
    

    see this fiddle

    or you can use just javascript:

    var a = document.querySelector('figure');
    if (a.classList) {
        a.classList.add('aden');
    } else {
        a.className += ' aden';
    }
    

    see this fiddle

提交回复
热议问题