0

我正在使用下面的代码从我网站上的链接创建画廊。我知道没有完全保护图像,但想在图像上添加透明覆盖。我可以通过将图像放在 div 标签中并使用 css 来查看执行此操作的方法,但我不确定这是否适合我正在使用的 javascript。

有没有人有办法在 javascript 中添加覆盖?

 <script type="text/javascript">
    var mygallery=new simpleGallery({
        wrapperid: "simplegallery1", //ID of main gallery container,
        dimensions: [250, 180], //width/height of gallery in pixels. Should reflect dimensions of the images exactly
        imagearray: [
            ["gallery/img1.png", "", "_new", "&copy; me"],
            ["gallery/img2.png", "", "_new", "&copy; me"],
            ["gallery/img3.png", "", "_new", "&copy; me"],

        ],
        autoplay: [true, 2500, 2], //[auto_play_boolean, delay_btw_slide_millisec, cycles_before_stopping_int]
        persist: false, //remember last viewed slide and recall within same session?
        fadeduration: 500, //transition duration (milliseconds)
        oninit:function(){ //event that fires when gallery has initialized/ ready to run
            //Keyword "this": references current gallery instance (ie: try this.navigate("play/pause"))
        },
        onslide:function(curslide, i){ //event that fires after each slide is shown
            //Keyword "this": references current gallery instance
            //curslide: returns DOM reference to current slide's DIV (ie: try alert(curslide.innerHTML)
            //i: integer reflecting current image within collection being shown (0=1st image, 1=2nd etc)
        }
    })
</script>
4

1 回答 1

0

在您的画廊上添加一个透明的 div。

你可以这样做:

.overlay {
    height : 100px; // height and width of your gallery
    width : 200px;
    z-index: 2000000!important;
    opacity:0.00001;
    position:absolute;
}

http://jsfiddle.net/659hq/

于 2013-04-10T15:29:27.973 回答