Skip to:
Content
Pages
Categories
Search
Top
Bottom

Add overlay to images in replies


  • ratsoid2
    Participant

    @ratsoid2

    I was trying to include Lighbox Plus in BBPress and my friend Dan made this functions, so that all the images and links to images will work in LP (or any other overlay image plugin that uses classes).


    <script type="text/javascript">
    jQuery(document).ready(function(){
    jQuery('.bbp-replies a').each(function(){
    var ext=(jQuery(this).attr('href').split('.').pop()).toLowerCase();
    if(jQuery(this).children('img').size()>0&&jQuery(this).attr('rel')=='nofollow'&&!jQuery(this).children('img').hasClass('avatar')||(ext=='jpg'||ext=='png'||ext=='gif')) jQuery(this).addClass('cboxModal');
    });
    });
    </script>

    Add this in header.php. Instead of “cboxModal”, replace the class with the desired one (WP-prettyPhoto for example).

  • You must be logged in to reply to this topic.
Skip to toolbar