Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7656563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T12:47:51+00:00 2026-05-31T12:47:51+00:00

Fancybox shows pikachoose image viewer in iframe. Keyboard keys are used to navigate between

  • 0

Fancybox shows pikachoose image viewer in iframe.
Keyboard keys are used to navigate between images
On initial load keys are ignored.
Keys will work only if clicked in fancybox.
I added

              $('.pikachoose').focus();

but this does not enable keys.
How to allow keys to work immediately if iframe is opened ?

iframe content is:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" <html>
<head>
    <link type="text/css" href="Pikachoose/bottom.css" rel="stylesheet" />
    <script type="text/javascript" src="jquery.min.js"></script>
    <script src="Pikachoose/jquery.pikachoose.full.js"></script>

    <script type="text/javascript">
            $(document).ready(function () {
                $("#pikame").PikaChoose({
                    autoPlay: false
                });

                $("html").keydown(function (evt) {
                    $('#pikame').data('pikachoose').Next();
                });
              // why this does not allow keydown event:
              $('.pikachoose').focus();
            });
    </script>
</head>
<body>
    <div class="pikachoose">
        <ul id="pikame">
            <li>
                <img src="img1" />
            </li>
            <li>
                <img src="img2" />
            </li>
            <li>
                <img src="img3" />
            </li>
        </ul>
    </div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T12:47:53+00:00Added an answer on May 31, 2026 at 12:47 pm

    Your jQuery selector is for an id, not a class.

    Either change your javascript to $(".pikachoose").focus() or change class="pikachoose" to id="pikachoose".

    edit:

    You can’t normally focus arbitrary elements, like divs. But there is a pseudo-hack that may work: puting a tabindex on the element. You can use -1 to prevent unwanted interference with tabbing. So either put tabindex="-1" on that div or you can put $(".pikachoose").attr("tabindex", -1).focus() in your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a standard image gallery using FancyBox. The page shows a list of
I have a gallery which uses Fancybox to load an iFrame inside the lightbox
I am using fancybox to display some images. Currently when users hover the image,
I have some content I want to show in iframe with fancybox. When I
I am using FancyBox to generate a popup image. FancyBox (In case you are
I am using fancybox to show Iframe within it like this.. $(document).ready(function() { $(#button).click(function()
i want to show a Vimeo video in an iframe using fancybox. This is
I use fancybox to show a popup window from another url, using iframe. Here
I just tried to display a flash file and an image with Fancybox. To
I'm working on a Facebook App that has a FancyBox (lightbox). The iframe is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.