Viewing 13 replies - 1 through 13 (of 13 total)
  • hi chaos_cb7 have you got a solution for it please let me know need it to implement on my site

    Hi, I would be very interested to have those arrows to navigate to left and right too!
    would be most grateful for someones solution!!

    Hi mikolein here the jquery script to get the keyboard navigation working in imagebrowser-caption view,plz add the code to imagebrowser-caption.php file withing the last closing of php tag <script>

    jQuery(document).keydown(function(e){

    if (e.keyCode == 37) {
    // alert( “left pressed” );
    window.location = “<?php echo $image->previous_image_link ?>#pic”;
    //alert(‘prev’);
    return false;
    }

    if (e.keyCode == 39) {
    window.location = “<?php echo $image->next_image_link ?>#pic”;
    //alert(‘next’);
    return false;

    }
    });

    </script>
    to get it working

    not sure that I understand where to add this code, in the page of the gallery?

    add this code in nextgen gallery files,in view folder you have imagebrowser-caption.php file there within php tag you should add

    shravyakalva-

    I tried to add in that code and it didn’t work. Could you please provide a slightly more detailed explanation of where to put it? When I put it in, the entire set of code looks like this:

    <?php
    /**
    Template Page for the image browser
    
    Follow variables are useable :
    
    	$image : Contain all about the image
    	$meta  : Contain the raw Meta data from the image
    	$exif  : Contain the clean up Exif data
    	$iptc  : Contain the clean up IPTC data
    	$xmp   : Contain the clean up XMP data 
    
     You can check the content when you insert the tag <?php var_dump($variable) ?>
     If you would like to show the timestamp of the image ,you can use <?php echo $exif['created_timestamp'] ?>
    **/
    ?>
    <?php if (!defined ('ABSPATH')) die ('No direct access allowed'); ?><?php if (!empty ($image)) : ?>
    
    <div class="ngg-imagebrowser" id="<?php echo $image->anchor ?>">
    
    	<h3><?php echo $image->alttext ?></h3>
    
    	<div class="pic"><?php echo $image->href_link ?></div>
    	<div class="ngg-imagebrowser-nav">
    		<div class="back">
    			<a class="ngg-browser-prev" id="ngg-prev-<?php echo $image->previous_pid ?>" href="<?php echo $image->previous_image_link ?>">◄ <?php _e('Back', 'nggallery') ?></a>
    		</div>
    		<div class="next">
    			<a class="ngg-browser-next" id="ngg-next-<?php echo $image->next_pid ?>" href="<?php echo $image->next_image_link ?>"><?php _e('Next', 'nggallery') ?> ►</a>
    		</div>
    		<div class="counter"><?php _e('Picture', 'nggallery') ?> <?php echo $image->number ?> <?php _e('of', 'nggallery')?> <?php echo $image->total ?></div>
    		<div class="ngg-imagebrowser-desc"><p><?php echo $image->description ?></p></div>
    	</div>	
    
    </div>	
    
    jQuery(document).keydown(function(e){
    
    if (e.keyCode == 37) {
    // alert( "left pressed" );
    window.location = "<?php echo $image->previous_image_link ?>#pic";
    //alert('prev');
    return false;
    }
    
    if (e.keyCode == 39) {
    window.location = "<?php echo $image->next_image_link ?>#pic";
    //alert('next');
    return false;
    
    }
    });
    
    <?php endif; ?>

    Thanks for any help you may be able to provide.

    hi jeff i’ll review this code n let u know in couple of hrs

    hi jeff u missed putting the code within script tag ,so please add it in this way:

    [ Moderator Note: Please post code or markup snippets between backticks or use the code button. Really, please use the code button, it makes the post much more readable. ]

    <script>
    
    	jQuery(document).keydown(function(e){
    
    		if (e.keyCode == 37) {
           // alert( "left pressed" );
    			window.location = "<?php echo $image->previous_image_link ?>#pic";
    			//alert('prev');
    		return false;
    		}
    
    		 if (e.keyCode == 39) {
    			window.location = "<?php echo $image->next_image_link ?>#pic";
    			//alert('next');
    		 return false;
    
    	}
    });
    
    </script>

    OK, I tried that but it still doesn’t seem to work.

    Aside from forgetting to put in the <script> and </script>, am I putting it in the right place?

    u have put on the right place,the code is working for me jeff will recheck n let u know soon

    Is it working ?
    I’d like to see a sample of it.

    I haven’t gotten it to work yet.

    Have you tried it minipada?

    I tried it and haven’t been able to get this to work. I tried it in the imagebrowser.php file and in the imagebrowser-caption.php file. Neither worked.

    I’d also love to have swipe navigation on mobile devices but haven’t had any luck with that.

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘[Plugin: NextGEN Gallery] arrow key navigation in image browser’ is closed to new replies.