1

サムネイルヘルパーで最新のファンシーボックスを使用しています。正常に動作しています。サムネイルオプションを変更できるかどうか知りたいです。現在、サムをクリックするとサムネールの位置が変わります。最初の画像から最後に行く場合、流れは左から右です。親指を中心に合わせて固定したい。誰もそれを達成する方法を知っていますか? ありがとう

4

5 に答える 5

3

私が取り組んだカスタムサムネラースクリプトでも同様の問題がありました。helpers フォルダーの jquery.fancybox-thumbs.js を編集する必要があります。

116 行目を次のように変更します。

this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor($(window).width() * 0.5 - ((this.width * (obj.group.length) * 0.5))));

次に、148 行目で次のようにします。

'left': Math.floor($(window).width() * 0.5 - (this.width * (obj.group.length) * 0.5))

これにより、ウィンドウのサイズを変更した場合に親指を中央に保ちながら、画像を変更するときに親指を中央に配置してアニメーションを削除する必要があります。

于 2012-08-31T01:14:18.570 に答える
2

window.innerWidthiOS の互換性のために、代わりに javascript のプロパティで @Scottorchard の回答を使用します$(window).width()

116 行目:

this.list.width(this.width * (obj.group.length + 1)).css('left', Math.floor(window.innerWidth * 0.5 - ((this.width * (obj.group.length) * 0.5))));

148 行目:

'left': Math.floor(window.innerWidth * 0.5 - (this.width * (obj.group.length) * 0.5))
于 2012-12-18T19:21:40.657 に答える
0

#fancybox-thumbs ul を置き換えます

#fancybox-thumbs ul {
position: relative;
list-style: none;
margin: auto;
padding: 0;
left: 0 !important;

}

于 2015-04-07T08:11:01.903 に答える