Support » Plugin: FancyBox » [Plugin: FancyBox] SUGGESTION: Class vs Rel Attribute for Image Grouping

  • Brian

    (@bkurious)


    Great plugin. I’ve used it with a lot of my sites.

    But I recently came across an issue with grouping image, specifically with the plugin’s use of the rel attribute instead of relying on a class.

    My problem was that the plugin is using rel=”fancybox” to fire Fancybox, which was over-writing the rel=”group1″, rel=”group2″, etc. in my image links and breaking the groups.

    In future updates, can you substitute “class” for your “rel” attribute? or is there a reason you decided to go with rel?

    http://wordpress.org/extend/plugins/fancy-box/

Viewing 1 replies (of 1 total)
  • lwinglewich

    (@lwinglewich)

    If you open fancybox.php and change

    <script type="text/javascript">
    	jQuery(document).ready(function($){
    		var select = $('a[href$=".bmp"],a[href$=".gif"],a[href$=".jpg"],a[href$=".jpeg"],a[href$=".png"],a[href$=".BMP"],a[href$=".GIF"],a[href$=".JPG"],a[href$=".JPEG"],a[href$=".PNG"]');
    		select.attr('rel', 'fancybox');
    		select.fancybox();
    
    	});
    </script>

    to

    <script type="text/javascript">
    	jQuery(document).ready(function($){
    		var select = $('a.className');
    		select.fancybox();
    	});
    </script>

    you’ll be able to group them into a slideshow by setting the rel attribute and you can set your own class by changing ‘className’

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: FancyBox] SUGGESTION: Class vs Rel Attribute for Image Grouping’ is closed to new replies.