Zum Inhalt springen

Perfectlightbox und Größe anpassen,aber Text verlinkt, nicht Bild

Erstellt am 14. Juli 2009 · 2 Antworten · letzte Antwort am 22. Oktober 2011

Tags: Frage

charlin ·

Hallo!

Habe die Perfectlightbox installiert und einen Text verlinkt, also kein Bild wie sonst üblich.
Das habe ich so angestellt:

<a href="uploads/tx_xy_extension/'.meintext.'" rel="lightbox[lb1]">

Das klappt sehr gut, jedoch weiß ich nicht, wie ich dieser Lightbox eine maximale Breite und Höhe zuweise.
Es wird immer das Bild in der Originalgröße in der Lightbox angezeigt.
Das ist natürlich viel zu groß.

Die nachfolgende Konfiguration greift natürlich nicht.

plugin.perfectlightbox.lightBoxMaxW = 100
plugin.perfectlightbox.lightBoxMaxH = 50

Kann ich das evtl. auch fest im Code der Extension einstellen???

Vielen Dank

matin ·

ich mache das immer so, dass ich das große bild für die lightbox einfach neu berechnen lasse, falls es eine maximal größe überschreitet:

#Bild verkleinern und mit Perfectlightbox verbinden
			//Original Verkleinern
			if($rowListeProdukte['bild'])
			{
				$imgTSConfigOrigA = array();
				$imgTSConfigOrigA['altText'] = $rowListeProdukte['title'];
				$imgTSConfigOrigA['titleText'] = $rowListeProdukte['title'];
				$imgTSConfigOrigA['file.']['maxW'] = 600;
				$imgTSConfigOrigA['file.']['maxH'] = 600;
				$imgTSConfigOrigA['file'] = 'uploads/tx_extensionname/'.$rowListeProdukte['bild'];
				$imgTSConfigOrigA['wrap'] = "|";
				$imgOrigA = $this->cObj->IMG_RESOURCE($imgTSConfigOrigA);
				
				$imgTSConfig = array();
				$imgTSConfig['altText'] = $rowListeProdukte['title'];
				$imgTSConfig['titleText'] = $rowListeProdukte['title'];
				$imgTSConfig['file.']['maxW'] = 175;
				$imgTSConfig['file.']['maxH'] = 130;
				$imgTSConfig['file'] = 'uploads/tx_extensionname/'.$rowListeProdukte['bild'];
				$imgTSConfig['wrap'] = "<a href=\"".$imgOrigA."\" title=\"".$rowListeProdukte['title']."\" rel=\"lightbox[presentlb15]\">|</a>";
					
				$img = $this->cObj->IMAGE($imgTSConfig);
				$markerArray['###BILD###']=$img;
			}
			else {
				$markerArray['###BILD###']= "Kein Bild angegeben";
			}