Lightbox funktioniert nicht nach Variantenauswahl

Hallo,

ich habe versucht die Lightbox einzubinden, was auch soweit recht gut geklappt hat. Nur nach der Auswahl einer Variante funktioniert es nicht mehr, dann springt er direkt in URL des Bildes ab und Bilder aus morepics funktionieren gar nicht mehr.

Folgendes habe ich getan:

[ol]
[li]Einbinden der Lightbox in base.tpl
[/li]


[{block name="base_style"}]
[{oxstyle include="css/reset.css"}]
[{oxstyle include="css/oxid.css"}]
[{oxstyle include="css/ie7.css" if="IE 7"}]
[{oxstyle include="css/ie8.css" if="IE 8"}]
[{oxstyle include="css/libs/jscrollpane.css"}]
[{oxstyle include="css/slimbox2.css"}]    
[{/block}]
 
[{block name="base_js"}]
[{oxscript include="js/libs/jquery.min.js" priority=1}]
[{oxscript include="js/libs/cookie/jquery.cookie.js" priority=1}]
[{oxscript include="js/libs/jquery-ui.min.js" priority=1}]
[{oxscript include='js/libs/superfish/hoverIntent.js'}]
[{oxscript include='js/libs/superfish/supersubs.js'}]
[{oxscript include='js/libs/superfish/superfish.js'}]
[{oxscript include='js/libs/dynamicload.js'}]
 [{oxscript include='js/slimbox2.js'}]
[{/block}]

[li]Änderungen der productmain.tpl
[/li]
Hier bin ich mir nicht ganz sicher, ob die Änderungen richtig sind, aber es funktioniert … wie gesagt.

<div class="picture">
<a href="[{$oPictureProduct->getMasterZoomPictureUrl(1)}]" rel='lightbox' data-zoomparams="adjustY:-2, zoomWidth:'354', fixZoomWindow:'390', trImg:'[{$oViewConf->getImageUrl('dot.png')}]', loadingText:'[{oxmultilang ident="PAGE_DETAILS_ZOOM_LOADING"}]'">
<img src="[{$oView->getActPicture()}]" alt="[{$oPictureProduct->oxarticles__oxtitle->value|strip_tags}] [{$oPictureProduct->oxarticles__oxvarselect->value|strip_tags}]">
</a>
</div>
[{else}]
<div class="picture">
<img src="[{$oView->getActPicture()}]" alt="[{$oPictureProduct->oxarticles__oxtitle->value|strip_tags}] [{$oPictureProduct->oxarticles__oxvarselect->value|strip_tags}]">
</div>

[li]Änderungen der morpics.tpl
[/li]

[{foreach from=$oView->getIcons() key=iPicNr item=oArtIcon name=sMorePics}]
<li>
<a id="morePics_[{$smarty.foreach.sMorePics.iteration}]" rel="lightbox[group]" href="[{$oPictureProduct->getMasterZoomPictureUrl($iPicNr)}]">
<span class="marker"><img src="[{$oViewConf->getImageUrl('marker.png')}]" alt=""></span>
<span class="artIcon"><img src="[{$oPictureProduct->getIconUrl($iPicNr)}]" alt=""></span>
</a>
</li>
[{/foreach}]

[/ol]

Man kann sich das ganze gerne aktuell mal anschauen … TestShop

Kann mir hier jemand helfen … ? :slight_smile:
Danke

Hallo schneiderItberatung,

dieses Problem kenne ich. Du musst in der Datei /application/views/azure/tpl/page/details/ajax/productmain.tpl ebenfalls nochmal die Scripts vor [{oxscript}] einbinden. “Problem” dabei ist, dass der Variantenwechsel per AJAX geschieht und die Javascript-Events wieder allen Elemente zugewiesen werden müssen.

Sollte funktionieren…

Hallo Kai,

ich hab in der webshop/application/views/azure/tpl/page/details/ajax/productmain.tpl wie du geschrieben hast:


[{oxscript include="js/slimbox2.js"}]
[{oxstyle include="css/slimbox2.css"}]

[{oxscript}]

eingebaut.
Leider hat sich keine Besserung gezeigt.

[QUOTE=schneiderItberatung;121612]


[{oxscript include="js/slimbox2.js"}]
[{oxstyle include="css/slimbox2.css"}]

[{oxscript}]

[/QUOTE]

Hallo schneiderItberatung,

ich habe “Scripts” geschrieben, nicht “Styles” :stuck_out_tongue: Bitte nur folgendes einbinden:

[{oxstyle include="css/slimbox2.css"}]

Aber das ist eigentlich nebensächlich…

Mir ist aber noch aufgefallen, dass jQuery zum Zeitpunkt der Einbindung von Slimbox noch gar nicht definiert ist und daher einen Error wirft. Dies könnte eine mögliche Ursache für das Fehlverhalten sein.
Du könntest mal noch versuchen, jQuery im -Bereich zu laden. Aber bitte nur jQuery und mit folgendem Code:

<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]js/libs/jquery.min.js"></script>

Viel mehr kann ich jetzt aus der Ferne gerade auch nicht helfen :frowning:

Vielen Dank Kai!

Viele Grüße
Martin