簡體   English   中英

是否可以在顯示在slimbox中的圖像中添加鏈接?

[英]Is it possible to add a link in the image that shows up in slimbox?

我有一個圖片庫,並且在其中使用了slimbox。 我想知道是否可以在單擊/懸停圖庫中的圖像后在顯示的圖像中添加鏈接,因為我能夠在標題/標題中添加鏈接。

<a rel='slimbox' href="images/img2.jpg" title="&lt;a href=&quot;http://www.google.com&quot; &gt;Google&lt;/a&gt;">
   <img class="cloudcarousel" src="images/img1.jpg" width="128" height="164" alt=""  />
</a>   

是。 您可以將標題/標題添加到每個圖像。 但是您不能直接添加指向圖像的鏈接。 嘗試像Slimbox演示一樣在標題中添加鏈接。 請檢查來源。 您可以了解一些自定義的想法。

<script type="text/javascript">//<![CDATA[
    window.addEvent("domready", function() {
        if (!/android|iphone|ipod|series60|symbian|windows ce|blackberry/i.test(navigator.userAgent)) {
            $$("a[href^=http://www.flickr.com/photos/] > img:first-child[src]").getParent().slimbox({
                loop: true,
                initialWidth: 1024,
                initialHeight: 768,
                overlayOpacity: 0.6,
                overlayFadeDuration: 200,
                resizeDuration: 1000,
                resizeTransition: Fx.Transitions.Elastic.easeOut,
                counterText: "This is image <strong>{x}</strong> on a total of <strong>{y}</strong> in this fabulous Flickr image gallery",
                previousKeys: [37, 80, 16],
                nextKeys: [39, 78, 17],
            }, function(el) {
                return [el.firstChild.src.replace(/_[mts]\.(\w+)$/, ".$1"),
                    (el.title || el.firstChild.alt) + '<br />Visit the <a href="' + el.href + '">Flickr page</a> for this picture.'];
            });
        }
        try {
            _gat._getTracker("UA-760577-1")._trackPageview();
        } catch(e) {}
    });
//]]></script>

<h2>Customization</h2>

    <p>You can change every parameter of Slimbox and make it work with any kind of link or element.<br />

    Below is an example of integration with Flickr links and custom options.</p>

    <p><a href="http://www.flickr.com/photos/14516334@N00/345009210/"><img src="http://farm1.static.flickr.com/159/345009210_1f826cd5a1_t.jpg" alt="A nice bee." /></a><a href="http://www.flickr.com/photos/alphageek/233472093/" title="Keyboard navigation is also customized here so you can use the Shift and Ctrl keys to navigate between images. Also, navigating to the next image will bring you back to the first one (loop option)."><img src="http://farm1.static.flickr.com/85/233472093_1f1d235e7b_t.jpg" alt="Flowers" /></a></p>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM