Lightbox 2 absolute Navigation
-
‚N Abend,
auf der Website, die ich verwalte, nutze ich Lightbox 2, um Bilder /Galerien anzuzeigen, doch stört mich, dass, wenn ich eine Galerie mit Lightworks anzeigen lasse, die Navigationspfeile erst erscheinen, wenn man mit der Maus über das Bild fährt. Deshalb würde ich die Navigationspfeile absolut links und rechts am Bild positionieren und bevor ich da den kompletten Code durcheinanderwerfe, hab ich mir gedacht, wende ich mich hier ans Forum.
Ich weiß nicht, ob folgendes was nützt, aber schaden wird’s bestimmt nicht. Und zwar hab ich da was in derwp-lightbox-2/wp-lightbox-2.js
gefunden:
function updateNav() { if (opts.imageArray.length > 1) { $('#hoverNav').show(); // if loopImages is true, always show next and prev image buttons if (opts.loopImages) { $('#prevLink,#prevLinkText').show().click(function () { changeImage((opts.activeImage == 0) ? (opts.imageArray.length - 1) : opts.activeImage - 1); return false; }); $('#nextLink,#nextLinkText').show().click(function () { changeImage((opts.activeImage == (opts.imageArray.length - 1)) ? 0 : opts.activeImage + 1); return false; }); } else { // if not first image in set, display prev image button if (opts.activeImage != 0) { $('#prevLink,#prevLinkText').show().click(function () { changeImage(opts.activeImage - 1); return false; }); } // if not last image in set, display next image button if (opts.activeImage != (opts.imageArray.length - 1)) { $('#nextLink,#nextLinkText').show().click(function () { changeImage(opts.activeImage + 1); return false; }); } } enableKeyboardNav(); } };
Hab mich auch vergewissert, dass
loopImages = true
ist:
$.fn.lightbox.defaults = { adminBarHeight:28, overlayOpacity: 0.8, borderSize: 10, imageArray: new Array, activeImage: null, inprogress: false, //this is an internal state variable. don't touch. widthCurrent: 250, heightCurrent: 250, xScale: 1, yScale: 1, displayTitle: true, disableNavbarLinks: true, loopImages: true, imageClickClose: true, jsonData: null, jsonDataParser: null, followScroll: true, isIE8: false //toyNN:internal value only };
Hier auch eine Website mit einer solchen Galerie: http://www.kljb-bechen.de/bildershow-casinonacht-2016/
Danke schonmal!
Nachtrag: Alternativ würde ich sonst die Navigationspfeil in der Leiste unter dem Bild je ganz außen positionieren! 🙂
-
Hi martinkljb.
Taugt Dir eventuell https://wordpress.org/plugins/shadowbox-js/screenshots/ etwas mehr?
- Das Thema „Lightbox 2 absolute Navigation“ ist für neue Antworten geschlossen.