Announcement

#1 2013-06-07 04:34:04

faq
Member
2013-06-03
16

[resolved] fancybox to open full size image

Hello,
I am using facnybox plugin, it works well for me even thou its not showing completable with 2.5.
the only problem is, it opens same medium size picture when I click on the image, how can I open full size picture

here is the code from the plugin

Code:

add_event_handler('render_element_content','winson_picture_content',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2);

function winson_picture_content($content, $element_info)
{
preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match);
if(isset($match) && count($match)>0){
  $content = str_replace($match[0],'<a id="single_image" href="'.$element_info['element_url'].'">'.$match[0].'</a>',$content);
}
return $content;
}

thank you

Offline

 

#2 2013-06-08 10:06:53

winson
Translation Team
China
2009-06-02
40

Re: [resolved] fancybox to open full size image

By default, the plugin will open the image size to fix with your browser screen(autoScale), if you want to show the original image size, just set the 'autoScale' to false that's ok:

following is the javascript code in the main.inc.php file:

Code:

var $var143 = jQuery.noConflict();
$var143(document).ready(function() { 
  $var143("a#single_image").fancybox({
    "hideOnContentClick": true,
    "padding":2,
    "margin":10,
    "autoScale":true  // change it to false
  });
});

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact