2012-07-12 59 views

回答

2

看一看the source code on Guthub,我不知道Photoswipe但我不得不在源一眼,发现如下:

/* 
    * Function: previous 
    */ 
    previous: function(){ 

     if (this.isZoomActive()){ 
      return; 
     } 

     if (!Util.isNothing(this.carousel)){ 
      this.carousel.previous(); 
     } 

    }, 



    /* 
    * Function: next 
    */ 
    next: function(){ 

     if (this.isZoomActive()){ 
      return; 
     } 

     if (!Util.isNothing(this.carousel)){ 
      this.carousel.next(); 
     } 

    } 

你可能想看看在代码中引用相应的转盘功能以上。

+0

我已经看过这种方法。 – user823415 2012-07-12 16:29:19

+0

我已经看过这种方法。但我的问题是调用这个方法。 例如,我创建了一个按钮,并且这必须执行一个操作方法(例如Next) – user823415 2012-07-13 07:08:28

+0

您可能需要再看一下@generalchaos答案,他似乎已经为您解决了它。如果是这种情况,你应该接受他的回答:) – 2013-05-28 11:08:06

1

的PhotoSwipe文档显示你如何实例代码:

// Set up PhotoSwipe with all anchor tags in the Gallery container 
$(document).ready(function(){ 

    var myPhotoSwipe = $("#Gallery a").photoSwipe({ enableMouseWheel: false , enableKeyboard: false }); 

}); 

要转到下一个图像,简单的调用 '下一步' 您photoSwipe实例作为这样的:

myPhotoSwipe.next(); 

OR'以前'回去

myPhotoSwipe.previous(); 

正如Denoir所说(谢谢!)。

希望这会有所帮助。 干杯。