English 中文(简体)
• 如何在被点击点上启动轮胎箱子 g
原标题:how to trigger fancybox-thumbs gallery on anchor click

Have any one tried to activate fancybox thumbnail gallery using a button or an anchor click, Currently one can use fancybox by clicking on the image which takes you to the popup image gallery, In my condition i want a simple button or an html anchor , so that when a user click on the button or anchor the modal popup gallery should be displayed. Also my images will be coming from db , Any ideas how to do this ???

缩略语

$( .fancybox-thumbs ).fancybox({
            prevEffect:  none ,
            nextEffect:  none ,

            closeBtn: false,
            arrows: false,
            nextClick: true,

            helpers: {
                thumbs: {
                    width: 50,
                    height: 50
                }
            }
        });

最新工作说明:

 $( a.gallery ).click(function () {
        $( .fancybox-thumb ).click();
    });
最佳回答

我正想到这一点(因为你先前曾问过这个问题),也许你可以尝试模拟第一组分级的点击。

$( #gallery ).click(function(){
      $( .fancybox-thumbs:first ).click();
});

让我知道

问题回答

你可以这样做: 界定具有特性和图像的阵列

var galPhotos = [{
        href :  ../img/galeria/fondo1.jpg , nextEffect  :  none ,   prevEffect    :  none , closeBtn: false,  arrows: false, nextClick: true, helpers: { thumbs: { width: 50, height: 50  } },
        href :  ../img/galeria/fondo2.jpg , nextEffect  :  none ,   prevEffect    :  none , closeBtn: false,  arrows: false, nextClick: true, helpers: { thumbs: { width: 50, height: 50  } },
        href :  ../img/galeria/fondo3.jpg , nextEffect  :  none ,   prevEffect    :  none , closeBtn: false,  arrows: false, nextClick: true, helpers: { thumbs: { width: 50, height: 50  } },
        href :  ../img/galeria/fondo4.jpg , nextEffect  :  none ,   prevEffect    :  none , closeBtn: false,  arrows: false, nextClick: true, helpers: { thumbs: { width: 50, height: 50  } }];

之后,只是

$( a#gallery ).live( click ,function(){
     $.fancybox(galPhotos);
});

自行检查,但地雷是(和工作罚款):

var galPhotos = [
                    {href :  ../img/galeria/fondo1.jpg , nextEffect  :  fade ,    prevEffect     :  fade }, 
                    {href :  ../img/galeria/fondo2.jpg , nextEffect  :  fade ,    prevEffect     :  fade },
                    {href :  ../img/galeria/fondo3.jpg , nextEffect  :  fade ,    prevEffect     :  fade }, 
                    {href :  ../img/galeria/fondo4.jpg , nextEffect  :  fade ,    prevEffect     :  fade },
                    {href :  ../img/galeria/fondo5.jpg , nextEffect  :  fade ,    prevEffect     :  fade },
                    {href :  ../img/galeria/fondo6.jpg , nextEffect  :  fade ,    prevEffect     :  fade } 
                ];

或简单模拟点击到那类

$( #gallery ).click(function(){
      $( .fancybox-thumbs:first ).click();
});

让我知道这怎么办。

或许这项工作:

<a class="fancybox-thumb" rel="fancybox-thumb" href="link_to_large_image.png" title="Image title">
<img src="link_to_small_image.png" alt="" />
</a>

新参观者

$( [data-fancybox="gallery"] ).fancybox({
    thumbs : {
      autoStart: true,
      axis:  x 
    }
  });




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签