简体   繁体   中英

reverse Lightbox effect

I am looking for a jquery script that does this effect: http://tympanus.net/Tutorials/CSS3Lightbox/

This one only uses CSS3, but I am looking for jQuery to act as a fallback for older browser support.

Does anyone know how this might be done?

Thanks.

You can modify this script to have slightly different opacity values and it should work for you: http://jsfiddle.net/Diodeus/gYyBL/

HTML:

<img src="http://i.imgur.com/vdDQgb.jpg" hoverImg="http://i.imgur.com/Epl4db.jpg"> 

JS:

$('body').find('*[hoverImg]').each(function(index){
    $this = $(this)
    $this.wrap('<div>')     
    $this.parent().css('width',$this.width())  
    $this.parent().css('height',$this.width())
    $this.parent().css('background-image',"url(" + $this.attr('hoverImg')+")")
        $this.hover(function() {
            $(this).stop()
            $(this).fadeTo('',.01)    
        },function() {
            $(this).stop()
            $(this).fadeTo('',1)             
        })                    
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM