Advertisement
Guest User

Fix for Easy Fancybox plugin to add captions

a guest
May 15th, 2012
1,451
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.36 KB | None | 0 0
  1. <script>
  2. jQuery(document).ready(function($) {
  3.     jQuery( 'a[href$=".jpg"], a[href$=".jpeg"], a[href$=".gif"], a[href$=".png"]' ).each( function () {
  4.             var imageTitle = '';
  5.             if ( jQuery( this ).next().hasClass( 'wp-caption-text' ) ) {
  6.                 imageTitle = jQuery( this ).next().text();
  7.             }
  8.            
  9.             jQuery( this ).attr( 'title', imageTitle );
  10.         });
  11.     });
  12. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement