简体   繁体   中英

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. It functions correctly on Mozilla and Chrome (by allowing for mouse over and links for the slideshow) but malfunctions with Internet Explorer. I only edited a small portion of the code to allow for basic HTML tags instead of just slideshow images. 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.

I think this has to do with the HTML output of your PHP script, not the actual PHP itself. Adding a semicollon might fix the problem.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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