使用 Drupal 和 jquery 工具在 IE 7 和 6 中出现问题

发布于 2024-08-14 03:57:19 字数 4569 浏览 7 评论 0原文

虽然 Jquery 工具代码似乎在 chrome 和 FF 中运行良好,但在 IE 6 或 7 中不起作用...... http://designbracket.com/ 我在我们的服务链接及其下方的链接上使用覆盖(请原谅现在正在格式化...仍在网站上工作)

    <?php jquery_plugin_add('overlay'); ?>

<?php
drupal_add_js(
'$(function() {  

 // positions for each overlay
 var positions = [ 
  [0,  530],
  [400, 20],
  [400, 530],
  [0,  20]    
 ]; 

 // setup triggers
 $("#Mone[rel],#Mtwo[rel], #Mthree[rel], #Mfour[rel]").each(function(i) {

  $(this).overlay({

   // common configuration for each overlay
   oneInstance: false, 
   closeOnClick: false, 

   // setup custom finish position
   top: positions[i][0],
   left: positions[i][1],



  });   
 });

});',
'inline'

); ?>
<STYLE>
div.overlay {

 /* growing background image */
 background-image:url(http://flowplayer.org/img/overlay/white.png);

 /* dimensions after the growing animation finishes  */
 width:600px;
 height:470px;  

 /* initially overlay is hidden */
 display:none;

 /* some padding to layout nested elements nicely  */
 padding:55px;
}

/* default close button positioned on upper right corner */
div.overlay div.close {
 background-image:url(http://flowplayer.org/img/overlay/close.png);
 position:absolute;
 right:5px;
 top:5px;
 cursor:pointer;
 height:35px;
 width:35px;
}

</STYLE>

<table style="margin-left:75px;">
<tr>
<td style="width:165px; vertical-align:top">
<a href="#" rel="div.overlay:eq(0)" id="Mone"style="color:#12636e;font-size:17pt;">Our Services</a></br>
<ul>
<li><a href="#" rel="div.overlay:eq(1)" id="Mtwo">Digital Media </a></li>
<li><a href="#" rel="div.overlay:eq(2)" id="Mthree">Online Marketing</a></li>
<li><a href="#" rel="div.overlay:eq(3)" id="Mfour">Websites</a></li>
</ul>
</td>


</tr>
</table>




 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay </h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#2</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#3</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#4</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 


 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#5</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

请建议我做什么才能使其在 IE 6 和 7 中工作。为了方便检查代码,我确保它包含 HTML 和 CSS。因此,要检查,只需在您的测试 drupal 站点中剪切复制粘贴即可。

谢谢

While the Jquery tools code seems to work well in chrome and FF it is not working in IE 6 or 7 ...
http://designbracket.com/ I am using Overlay on the Our Services Link and the links under it (please excuse the formatting for now... still working on the site)

    <?php jquery_plugin_add('overlay'); ?>

<?php
drupal_add_js(
'$(function() {  

 // positions for each overlay
 var positions = [ 
  [0,  530],
  [400, 20],
  [400, 530],
  [0,  20]    
 ]; 

 // setup triggers
 $("#Mone[rel],#Mtwo[rel], #Mthree[rel], #Mfour[rel]").each(function(i) {

  $(this).overlay({

   // common configuration for each overlay
   oneInstance: false, 
   closeOnClick: false, 

   // setup custom finish position
   top: positions[i][0],
   left: positions[i][1],



  });   
 });

});',
'inline'

); ?>
<STYLE>
div.overlay {

 /* growing background image */
 background-image:url(http://flowplayer.org/img/overlay/white.png);

 /* dimensions after the growing animation finishes  */
 width:600px;
 height:470px;  

 /* initially overlay is hidden */
 display:none;

 /* some padding to layout nested elements nicely  */
 padding:55px;
}

/* default close button positioned on upper right corner */
div.overlay div.close {
 background-image:url(http://flowplayer.org/img/overlay/close.png);
 position:absolute;
 right:5px;
 top:5px;
 cursor:pointer;
 height:35px;
 width:35px;
}

</STYLE>

<table style="margin-left:75px;">
<tr>
<td style="width:165px; vertical-align:top">
<a href="#" rel="div.overlay:eq(0)" id="Mone"style="color:#12636e;font-size:17pt;">Our Services</a></br>
<ul>
<li><a href="#" rel="div.overlay:eq(1)" id="Mtwo">Digital Media </a></li>
<li><a href="#" rel="div.overlay:eq(2)" id="Mthree">Online Marketing</a></li>
<li><a href="#" rel="div.overlay:eq(3)" id="Mfour">Websites</a></li>
</ul>
</td>


</tr>
</table>




 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay </h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#2</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#3</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#4</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 


 <div class="overlay"> 
  <h2 style="margin:10px 0">Overlay <me>#5</me></h2> 

  <p style="float: left; margin:0px 20px 20px 0;"> 
   <img src="http://static.flowplayer.org/img/title/tools24.png" /> 
  </p> 

  <p> 
    Class aptent taciti sociosqu ad litora torquent per conubia nostra, 
    per inceptos himenaeos. Donec lorem ligula, elementum vitae, 
    imperdiet a, posuere nec, ante. Quisque mattis massa id metus.
  </p> 
 </div> 

Kindly suggest what shud I do to make it work in IE 6 and 7 . To make it convenient to check the code I have ensured that it has the HTML and CSS within it .. So to check simply cut copy paste in ur test drupal site.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

木有鱼丸 2024-08-21 03:57:20

我能够解决这个问题..显然 IE 造成麻烦只是由于一个额外的逗号..

I was able to fix the problem .. Apparently IE was causing trouble only thanks to an extra comma..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文