Note that there are some explanatory texts on larger screens.

plurals
  1. POGreybox not appearing, don't know why (PHP, Javascript)
    primarykey
    data
    text
    <p>I have a website written in PHP. I'm trying to integrate Greybox using imagesets as described at the bottom of this page (http://orangoo.com/labs/greybox/advance_usage.html), but the popup isn't working. All the HTML works out and the code seems correct, but when I click on one of the links that's supposed to show an imageset, the '#' appears at the end of the URL but nothing else happens.</p> <p>I've searched for answers on the Greybox website, on here, and with Google, but I just can't figure out why this isn't working. Here's the relevant code:</p> <p>In the HTML header:</p> <pre><code>&lt;script type="text/javascript"&gt; var GB_ROOT_DIR = "greybox/"; &lt;/script&gt; &lt;script type="text/javascript" src="greybox/AJS.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="greybox/AJS_fx.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="greybox/gb_scripts.js"&gt;&lt;/script&gt; &lt;link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" /&gt; </code></pre> <p>In the PHP:</p> <pre><code>// create imagesets for Greybox echo '&lt;script&gt;'; foreach($series_list as $series) { echo 'var ',$series-&gt;name,' = ['; $buf = ''; foreach($series-&gt;photos as $photo) { $buf .= "{'caption': '" . $series-&gt;name_formatted . "', 'url': '" . $photo-&gt;path . "'},"; } $buf = rtrim($buf, ','); // trim the last comma echo $buf; echo '];'; } echo '&lt;/script&gt;'; echo '&lt;div class="series"&gt;'; // display list of series foreach($series_list as $series) { echo '&lt;span class="series"&gt;&lt;a href="#" onclick="return GB_showImageSet(',$series-&gt;name,', 1)"&gt;',$series-&gt;name_formatted,'&lt;/a&gt;&lt;/span&gt;'; echo '&lt;br&gt;'; } echo '&lt;/div&gt;'; </code></pre> <p>Thanks for your help! I'm fairly new to PHP and Javascript, so there may be a glaring error that I haven't caught.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload