SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Palo Alto, CA
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    .keydown is breaking accordion() - why?

    http://jsfiddle.net/cnpEe/

    So the 'ctrl+f' keydown works beautifully, but the 'esc' keydown is breaking the accordion. Any ideas why?

    Thanks for your help!
    Code:
                <script  type ="text/javascript" >
                  $(document).ready(function() {
                    $("#resume-trd").accordion();
                  });
    
                /* capture ctrl+f and open all accordion */
                $(document).keydown(function(e){
                    if ((e.keyCode == 70) && (e.ctrlKey == true)) {
                        $('#resume-trd .ui-accordion-content').slideDown();
                    }
                });
                /* capture esc */
                $(document).keydown(function(e){
                    if (e.keyCode == 27) {
                        $('#resume-trd .ui-accordion-content').slideUp();
                    }
                });
                </script>
    Last edited by falieson; Oct 13, 2011 at 08:39. Reason: Added code inline

  2. #2
    SitePoint Addict sdleihssirhc's Avatar
    Join Date
    Feb 2009
    Posts
    387
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Where are you getting the "accordion" function? Can you post a more complete fiddle, that includes all the relevant HTML, CSS, and JS?
    I'm the web overlord for Graphic Business Systems

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2005
    Location
    Palo Alto, CA
    Posts
    76
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply, I think i'm going to go another direction with the whole project. Thanks!


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
  •