How to display fancybox title only on image hover

前端 未结 2 1609
孤街浪徒
孤街浪徒 2021-01-07 11:10

I\'m using the Fancybox plugin for an image gallery, and I want to display the image titles only when the user hovers over the image. I cannot figure out what part of the co

2条回答
  •  Happy的楠姐
    2021-01-07 11:48

    From their site:

    Make sure this is in your main page at the top:

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    Then add this type of syntax to the images you want to do this with.

    
    
    

    Lastly, make it all function with a little bit of jScript.

    
    

    And if you're still having trouble, refer here: http://docs.jquery.com/Tutorials:How_jQuery_Works

    To make the descriptions appear as you requested, maybe try this in the javascript:

    $(document).ready(function() {
        $(".fancybox").fancybox({
            openEffect  : 'none',
            closeEffect : 'none'
        });
    });
    

    And this as your image syntax:

    
        
    
    

提交回复
热议问题