0

私は自分のサイトでこのハイスライドの例を使用しています:- .

http://www.roadrash.no/hs-support/gallery-in-page-with-large-imagelink-in-caption.html .

キャプション領域の既存のリンクの横に別のリンクを追加する必要があります。どうすればいいのですか?.

どうもありがとう。

4

2 に答える 2

0

この新しいデモをご覧ください: http://roadrash.no/hs-support/gallery-in-page-with-large-imagelink-in-caption-and-additional-link.htmlこれはデモの修正版ですあなたはすでに使用しています。

これを古いデモに置き換えます。

// Inserting link to large image in caption
hs.Expander.prototype.onAfterGetCaption = function(sender) {
    if (sender.caption) {
        sender.caption.innerHTML += '<br /><a href="' + sender.content.src + '" class="highslide" onclick="return stopSlideshowAndExpand(this, largeImage)">View large image</a>';
    }
};

これとともに:

// Inserting link to large image and additional link in the caption
hs.Expander.prototype.onAfterGetCaption = function(sender) {
    if (sender.caption) {
        sender.caption.innerHTML += '<br /><a href="' + sender.content.src + '" class="highslide" onclick="return stopSlideshowAndExpand(this, largeImage)">View large image</a><br /><a href="' + this.custom.url + '" class="highslide" target="_blank"><span style="font-size: 12px; font-style: italic;">Go to ' + this.custom.linktext + ' </span><span style="font-size: 7px; font-style: italic;">(opens in new tab)</span></a>';
    }
};

新しいデモの画像の HTML マークアップは次のようになります。

<a class='highslide' href='images/016.large.jpg' onclick="return hs.expand(this, inPageOptions, {url: 'http://highslide.com/ref/', linktext: 'Highslide API reference page'} )">
    <img src='images/016.smallthumb.jpg' alt='Autumn leaves'/>
</a>

urlとのコンテンツをlinktext独自の URL とテキストに置き換えます。

于 2013-05-07T09:19:19.077 に答える