Problems with PrettyPhoto Jquery Lightbox

I use the fantastic PrettyPhoto lightbox, a jQuery lambbox clone.

To run a lightbox with an iframe, this is the code

<a href="http://www.google.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" title="Google.com opened at 100%">Google.com</a>

It works great!

The problem is that I use javascript to create some of my div links with this code

<div onclick="http://www.google.com?iframe=true&width=100%&height=100%" rel="prettyPhoto[iframes]" class="menuitem">

Unfortunately this will not work. I suspect this is because the DIV does not support the rel attribute. Does anyone have any ideas on how to do this?

Thank you for your help,

Tim

+3
source share
1 answer

Mark line 87 of the js plugin file (jquery.prettyPhoto.js)

$('a[rel*='+theGallery+']').each(function(i){

He specifically searches for 'a' elements. You can view the plugin and change a few things to make it work for your needs.

$('div[rel*='+theGallery+']').each(function(i){

, , rel div. - selectable.

+4

Source: https://habr.com/ru/post/1723305/


All Articles