<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Juicebox Support Forum — Button Keyboard Accessibility?]]></title>
		<link>https://juicebox.net/forum/viewtopic.php?id=5365</link>
		<atom:link href="https://juicebox.net/forum/extern.php?action=feed&amp;tid=5365&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Button Keyboard Accessibility?.]]></description>
		<lastBuildDate>Tue, 26 Dec 2023 13:12:54 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Button Keyboard Accessibility?]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=18628#p18628</link>
			<description><![CDATA[<div class="quotebox"><cite>lukeleber wrote:</cite><blockquote><p>I&#039;ve noticed that 1.5.1 doesn&#039;t have keyboard accessible expand buttons.&nbsp; Any chance this can be resolved somehow?</p></blockquote></div><p>you can use the tabindex attribute in HTML to make elements keyboard-focusable.</p><p>Look at the javascript example.</p><div class="codebox"><pre><code>&lt;button class=&quot;expand-button&quot; tabindex=&quot;0&quot; aria-label=&quot;Expand&quot;&gt;Expand&lt;/button&gt;

&lt;script&gt;
  const expandButton = document.querySelector(&#039;.expand-button&#039;);
  
  expandButton.addEventListener(&#039;keydown&#039;, function(event) {
    if (event.key === &#039;Enter&#039; || event.key === &#039; &#039;) 
    { 
      console.log(&#039;Expand functionality triggered.&#039;);
    }
  });
&lt;/script&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (nehavilash)]]></author>
			<pubDate>Tue, 26 Dec 2023 13:12:54 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=18628#p18628</guid>
		</item>
		<item>
			<title><![CDATA[Re: Button Keyboard Accessibility?]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=18410#p18410</link>
			<description><![CDATA[<p>I think this might be undocumented but try &#039;F&#039; to expand the gallery (fullscreen) and ESC to close the gallery.</p><p>Notes:</p><p>(1) Juicebox-Pro only (set <strong>enableKeyboardControls=&quot;TRUE&quot;</strong>).</p><p>(2) The gallery must have focus (need to click somewhere within the gallery before pressing &#039;F&#039; (or any other keyboard control)).</p><p>(3) As with the example in my previous post, this does not work if the gallery is expanded in a new page (no easy solution).</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Mon, 13 Feb 2023 07:57:57 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=18410#p18410</guid>
		</item>
		<item>
			<title><![CDATA[Re: Button Keyboard Accessibility?]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=18409#p18409</link>
			<description><![CDATA[<p>You could create a custom JavaScript event listener in your gallery&#039;s embedding page which triggers the Juicebox-Pro API <strong>toggleExpand()</strong> method (to expand/close the gallery) when a certain key is pressed.<br />Here&#039;s an example which toggles the gallery&#039;s expanded status when the &#039;x&#039; key is pressed.</p><p>To see this example in action, create a sample gallery with JuiceboxBuilder-Pro and use the following code as the gallery&#039;s &#039;index.html&#039; page.<br /></p><div class="codebox"><pre><code>&lt;!DOCTYPE html&gt;
&lt;html lang=&quot;en&quot;&gt;
    &lt;head&gt;
        &lt;meta charset=&quot;utf-8&quot; /&gt;
        &lt;meta name=&quot;viewport&quot; id=&quot;jb-viewport&quot; content=&quot;width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0&quot; /&gt;
        &lt;style&gt;
            body {
                margin: 0px;
            }
        &lt;/style&gt;
        &lt;script src=&quot;jbcore/juicebox.js&quot;&gt;&lt;/script&gt;
        &lt;script&gt;
            var jb = new juicebox({
                containerId: &quot;juicebox-container&quot;,
                galleryHeight: &quot;400&quot;,
                galleryWidth: &quot;600&quot;
            });
            jb.onInitComplete = function() {
                window.addEventListener(&#039;keydown&#039;, function(e) {
                    if (e.keyCode === 88) {
                        jb.toggleExpand();
                    }
                });
            };
        &lt;/script&gt;
        &lt;title&gt;Test&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;div id=&quot;juicebox-container&quot;&gt;&lt;/div&gt;
    &lt;/body&gt;
&lt;/html&gt;</code></pre></div><p>Notes:</p><p>(1) Use of the <a href="https://www.juicebox.net/support/api/">Juicebox-Pro API</a> requires Juicebox-Pro. Unfortunately, this will not work with Juicebox-Lite.</p><p>(2) This should work fine with a regular gallery or when <strong>useFullscreenExpand=&quot;TRUE&quot;</strong> but it will not work if the gallery is expanded in a new page (e.g. on an iOS device or when <strong>expandInNewPage=&quot;TRUE&quot;</strong>). In order to close a gallery which has been expanded in a new page, the code would need to be incorporated into the gallery&#039;s &#039;<em>jbcore/full.html</em>&#039; page as well as the gallery&#039;s embedding page.</p><p>(3) Keycodes (if you wanted to change the &#039;x&#039; key for something else) can be found here: <a href="https://css-tricks.com/snippets/javascript/javascript-keycodes/">https://css-tricks.com/snippets/javascr … -keycodes/</a></p><p>As this does not work with Juicebox-Lite, you might like to post this as a suggestion for a future version in the <a href="https://juicebox.net/forum/viewtopic.php?id=5">Feature Requests</a> forum thread.<br />I do not know what suggestions might be incorporated into future versions but this is the best place for all ideas to ensure that they are seen by the developers. (I know the Feature Requests forum thread is a sub-forum of the Juicebox-Pro forum but there&#039;s no specific Feature Requests thread for Juicebox-Lite so this is still the best place to post.)<br />Thank you.</p>]]></description>
			<author><![CDATA[null@example.com (Steven @ Juicebox)]]></author>
			<pubDate>Mon, 13 Feb 2023 07:39:06 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=18409#p18409</guid>
		</item>
		<item>
			<title><![CDATA[Button Keyboard Accessibility?]]></title>
			<link>https://juicebox.net/forum/viewtopic.php?pid=18408#p18408</link>
			<description><![CDATA[<p>I&#039;ve noticed that 1.5.1 doesn&#039;t have keyboard accessible expand buttons.&nbsp; Any chance this can be resolved somehow?</p>]]></description>
			<author><![CDATA[null@example.com (lukeleber)]]></author>
			<pubDate>Sun, 12 Feb 2023 23:44:25 +0000</pubDate>
			<guid>https://juicebox.net/forum/viewtopic.php?pid=18408#p18408</guid>
		</item>
	</channel>
</rss>
