2012-05-30 2 views
1

Я отредактировал слайд-шоу на целевой странице сайта Drupal, напрямую обратившись к PHP «page.tpl.php», и теперь сайт не будет работать на IE8. Он корректно функционирует в Mozilla и Chrome (позволяя мыши и ссылки для слайд-шоу), но не работает с Internet Explorer. Я только отредактировал небольшую часть кода, чтобы можно было использовать базовые теги HTML, а не только изображения слайд-шоу. Я изменил это:PHP Slideshow не работает в Internet Explorer

<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 
       } 
       ?> 

Для этого:

<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 
       } 
       ?> 

И оставил все остальное то же самое. Если у кого-то есть какие-либо решения или можно указать мне в правильном направлении, это будет очень признательно.

P.S. ($ lang_name == "en") заключается в том, что на сайте установлен модуль перевода.

+3

Это проблема строго с HTML, а не с PHP. Посмотрите на использование кавычек и одинарных кавычек и без конечных привязок ('') на своих 'a href's. – PenguinCoder

+1

[Validate your html] (http://validator.w3.org/#validate_by_input), вероятно, является хорошим предложением (так что вывод вашего сайта, а не PHP-код его построения). И, видя ваш js, я бы предложил изучить немного более умный способ сделать это, единственным реальным изменением является число 1, которое изменяется на 2 в наведении мыши .... sooo, почему бы не заменить только это число на js, который не является смешивается с остальной частью html? : -/Или укажите альтернативную ссылку в свойстве данных и снова наведите указатель мыши в отдельный файл js. – sg3s

ответ

0

Я думаю, что это связано с выходом HTML вашего PHP-скрипта, а не с самим PHP. Добавление полукольца может решить проблему.

<img onmouseout="this.src='<?php print $base_path . $directory;?>/images/slideshows/TransactionsFR1.png';" 
Смежные вопросы