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 8754957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:44:48+00:00 2026-06-13T13:44:48+00:00

I use boostrap carousel inside of a modal window. Code of that looks like

  • 0

I use boostrap carousel inside of a modal window.

Code of that looks like this:

<div id="modal-window-slideshow" data-backdrop="static" class="modal-huge hide fade">
  <div class="modal-header">
    <button type="button" data-dismiss="modal" class="close" aria-hidden="true">×</button>
    <h3>Slides</h3>
  </div>
  <div class="modal-huge-body">
    <div id="myCarousel" class="carousel slide">
      <!-- Carousel items -->
      <div id="div-carousel-items" class="carousel-inner">

      <!-- Carousel nav -->
      <a href="#myCarousel" data-slide="prev" class="carousel-control left">‹</a>
      <a href="#myCarousel" data-slide="next" class="carousel-control right">›</a>
    </div>
  </div>
</div>

When user clicks next and prev buttons everything works fine. But i also want to allow user to navigate via left and right arrows on keyboard. I wrote code which does it, but i met strange problem: transitions animation in this case doesn’t work. Can i enable that?

My script

$(document).keypress(function(event) {
  var LEFT_ARROW = 39; var RIGHT_ARROW = 37;

  if (typeof event !== 'undefined' && $('#modal-window-slideshow').is(':visible')) {
    if (event.keyCode === RIGHT_ARROW) {
      $(this).carousel('next');
    }

    if (event.keyCode === LEFT_ARROW) {
      $(this).carousel('prev');
    }
  }
  return true;
});
  • 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-06-13T13:44:49+00:00Added an answer on June 13, 2026 at 1:44 pm

    I think, i found the workaround. I just seek necessary links and then click it.

    $(document).keypress(function(event) {
        var LEFT_ARROW = 39; var RIGHT_ARROW = 37;
    
        if (event.keyCode === RIGHT_ARROW) {
          $('a.carousel-control.right').trigger('click');
        }
    
        if (event.keyCode === LEFT_ARROW) {
          $('a.carousel-control.left').trigger('click');
        }
       ...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use bootstrap and am trying to center a div(span7) like that: <div class=row-fluid>
I would like to use the .navbar-search class in Boostrap, but I would like
I use twitter-boostrap and I'd like to use these radio-buttons in my form. The
Here is the function I'm thinking of. I would use the javascript in boostrap
I'm trying to use twitter bootstrap to create Facebook like tooltip layout. I would
I wrote this piece of code to my bootstrap public function _initRouter() { $pages
Hi folks I have a map in my bootstrap.groovy, how can use this map
I'd like to use Bootstrap from Twitter in my ASP.Net MVC 3 application. I
I’m using Drupal (please note that this is not a Drupal related question), and
I've got an application receiving some data through AJAX-call. After that, received data binds

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.