Trying to make the up arrow key zoomIn

Discussion in 'jQuery' started by harryf, Jan 14, 2013.

  1. #1
    Hello I am using a plugin called wowBook, I have it running ok on this page: http://eyeballcomix.co.uk/issue-1/ .
    I have it set up so that the left and right arrow keys on the keyboard move the pages left and right. I would like to set it up so that the up and down arrows zoom in and out.
    If any one could help me achieve this it would be very much appreciated.
    Here is the code used:

    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>


    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>


    <script type="text/javascript" src="http://www.eyeballcomix.co.uk/js/wow_book_plugin/wow_book/wow_book.min.js"></script>


    <link rel="stylesheet" href="http://www.eyeballcomix.co.uk/js/wow_book_plugin/developer_version/wow_book.css" type="text/css">


    <script type="text/javascript">


    jQuery(document).ready(function() {
    jQuery('#nicotine').wowBook({
    height : 410
    ,width : 600
    ,flipSound : false
    ,mouseWheel : "zoom"
    ,centeredWhenClosed : true
    ,zoomStep : 0.5

    ,keyboardNavigation : { back : 37, advance : 39 }
    ,pageNumbers : false



    ,controls : {
    next : '#next',
    back : '#back',
    first : '#first',
    last : '#last',
    zoomIn : '#zoomin',
    zoomOut : '#zoomout',

    }
    });
    jQuery("#nicotine").unbind("touchstart")
    });


    var book=jQuery.wowBook("#nicotine");
    jQuery("#zoomin").click(function(){ book.zoomIn() });
    jQuery("#zoomout").click(function(){ book.zoomOut() });
    </script>


    Any help would be very much apreciated

    all the best

    Harry
     
    harryf, Jan 14, 2013 IP
  2. artus.systems

    artus.systems Well-Known Member

    Messages:
    87
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    103
    #2
    Something like this should work (not tested)

    $(document).keydown(function(e){
        if (e.keyCode == 38) { 
           $("#zoomin").trigger('click');
           return false;
        }
    });
    Code (markup):
     
    artus.systems, Jan 15, 2013 IP
  3. harryf

    harryf Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thank you ever so much artus.systems it worked perfectly you have saved my day.
     
    harryf, Jan 15, 2013 IP