简体   繁体   English

PHP幻灯片无法在Internet Explorer上运行

[英]PHP Slideshow Won't Work on Internet Explorer

I edited the slideshow on my Drupal site's landing page by accessing the PHP "page.tpl.php" directly and now the site won't work on IE8. 我通过直接访问PHP“ page.tpl.php”在Drupal网站的目标页面上编辑了幻灯片,现在该网站无法在IE8上运行。 It functions correctly on Mozilla and Chrome (by allowing for mouse over and links for the slideshow) but malfunctions with Internet Explorer. 它可以在Mozilla和Chrome上正常运行(通过允许鼠标悬停和幻灯片链接),但Internet Explorer会出现故障。 I only edited a small portion of the code to allow for basic HTML tags instead of just slideshow images. 我只编辑了一小部分代码以允许使用基本的HTML标签,而不仅仅是幻灯片图像。 I changed this: 我改变了这个:

<div class="slideshow">
                <?php
                if($lang_name == "en"){
                ?>
                    <img src="<?php print $base_path . $directory; ?>/images/slideshows/ENGreplacementworkingoncomputer.png" width="950" height="355" alt="Legal Logik"/>
                    <img src="<?php print $base_path . $directory; ?>/images/slideshows/ENGreplacementhandshake.png" width="950" height="355" alt="Legal Logik"/>
                    <img src="<?php print $base_path . $directory; ?>/images/slideshows/ENGreplacementgirlstanding.png" width="950" height="355" alt="Legal Logik"/>
                <?php
                }else{
                ?>
                    <img src="<?php print $base_path . $directory; ?>/images/slideshows/FRreplacementworkingoncomputer.png" width="950" height="355" alt="Legal Logik"/>
                    <img src="<?php print $base_path . $directory; ?>/images/slideshows/FRreplacementhandshake.png" width="950" height="355" alt="Legal Logik"/>
                    <img src="<?php print $base_path . $directory; ?>/images/slideshows/FRreplacementgirlstanding.png" width="950" height="355" alt="Legal Logik"/>
                <?php
                }
                ?>  

To this: 对此:

<div class="slideshow">
                <?php
                if($lang_name == "en"){
                ?>
                    <a href="https://www.legallogik.com/incorporation">
                    <img onmouseout="this.src='<?php print $base_path . $directory; ?>/images/slideshows/IncorporationENG1.png'" onmouseover="this.src='<?php print $base_path . $directory; ?>/images/slideshows/IncorporationENG2.png'" src="<?php print $base_path . $directory; ?>/images/slideshows/IncorporationENG1.png" width="950" height="355" alt="Legal Logik"/>
                    <a href="https://www.legallogik.com/business-transactions">
                    <img onmouseout="this.src='<?php print $base_path . $directory; ?>/images/slideshows/TransactionsENG1.png'" onmouseover="this.src='<?php print $base_path . $directory; ?>/images/slideshows/TransactionsENG2.png'" src="<?php print $base_path . $directory; ?>/images/slideshows/TransactionsENG1.png" width="950" height="355" alt="Legal Logik"/>
                    <a href="https://www.legallogik.com/services">
                    <img onmouseout="this.src='<?php print $base_path . $directory; ?>/images/slideshows/ServicesENG1.png'" onmouseover="this.src='<?php print $base_path . $directory; ?>/images/slideshows/ServicesENG2.png'" src="<?php print $base_path . $directory; ?>/images/slideshows/ServicesENG1.png" width="950" height="355" alt="Legal Logik"/>
                <?php
                }else{
                ?>
                    <a href="https://www.legallogik.com/fr/forfaits-dincorporation">
                    <img onmouseout="this.src='<?php print $base_path . $directory; ?>/images/slideshows/IncorporationFR1.png'" onmouseover="this.src='<?php print $base_path . $directory; ?>/images/slideshows/IncorporationFR2.png'" src="<?php print $base_path . $directory; ?>/images/slideshows/IncorporationFR1.png" width="950" height="355" alt="Legal Logik"/>
                    <a href="https://legallogik.com/fr/Transactions-Commerciales">
                    <img onmouseout="this.src='<?php print $base_path . $directory; ?>/images/slideshows/TransactionsFR1.png'" onmouseover="this.src='<?php print $base_path . $directory; ?>/images/slideshows/TransactionsFR2.png'" src="<?php print $base_path . $directory; ?>/images/slideshows/TransactionsFR1.png" width="950" height="355" alt="Legal Logik"/>
                    <a href="https://legallogik.com/fr/nos-services">
                    <img onmouseout="this.src='<?php print $base_path . $directory; ?>/images/slideshows/ServicesFR1.png'" onmouseover="this.src='<?php print $base_path . $directory; ?>/images/slideshows/ServicesFR2.png'" src="<?php print $base_path . $directory; ?>/images/slideshows/ServicesFR1.png" width="950" height="355" alt="Legal Logik"/>
                <?php
                }
                ?>  

And left everything else the same. 剩下的一切都一样。 If anyone has any solutions or can point me in the right direction it would be much appreciated. 如果任何人有任何解决方案或可以指出正确的方向,将不胜感激。

PS the ($lang_name =="en") is because the site has a translation module installed. PS($ lang_name ==“ en”)是因为该站点已安装翻译模块。

I think this has to do with the HTML output of your PHP script, not the actual PHP itself. 我认为这与PHP脚本的HTML输出有关,而不与实际的PHP本身有关。 Adding a semicollon might fix the problem. 添加分号可能会解决该问题。

<img onmouseout="this.src='<?php print $base_path . $directory;?>/images/slideshows/TransactionsFR1.png';"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM