SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Location
    Brampton, Ontario, Canada
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Space bar isn't working on my sites comment field.

    Hello all,

    I'm having a strange problem. The space bar does not work when typing in my sites comment field.
    I'm assuming that I have a javascript plugin which is messing with things, however I haven't been able to find the culprit.

    Can anybody give me advice as to where I can look for the problem? Thanks in advance.

    Here's the site: http://copyandmailetc.com/?p=216

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    5,890
    Mentioned
    211 Post(s)
    Tagged
    12 Thread(s)
    Hi,

    On line 641 of your page you have the following code:

    Code JavaScript:
    if(settings.allowKeyboardCtrl){
      jQuery(document).bind('keydown', function(e){
        if(e.which==39){
          nextSlide = ActSlide-1;
          stopAutoplay();
          jumpTo(nextSlide);
        }else if(e.which==37){
          prevSlide = ActSlide+1;
          stopAutoplay();
          jumpTo(prevSlide);
        }else if(e.which==32){
          if(intval){stopAutoplay();}
          else{autoplay();}
          return false;
        }
      });
    }

    In this line:

    Code JavaScript:
    }else if(e.which==32){

    32 is the keycode for the space bar.
    The return false; two lines later is what is preventing anything from happening when you press it.

    The above JavaScript seems to relate to the images which fade in and out under the headings "Our Store".
    Whilst it is important to not neglect keyboard users (for example when you have a proper image gallery), in this case I'm not sure that this extra functionality is warranted.
    The easiest thing might be to just remove it.

  3. #3
    SitePoint Member
    Join Date
    Jan 2013
    Location
    Brampton, Ontario, Canada
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much for your help! You're awesome.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •