Internet Explorer Javascript 幻灯片

发布于 2024-12-09 20:01:37 字数 1148 浏览 1 评论 0原文

我这里发生了一个非常奇怪的问题。它只发生在 Internet Explorer 上(真是令人惊讶)。

基本上我正在尝试修复一些三流开发人员完成后给我的网站,并且显然没有在 IE 上进行测试。

他们已经设置了一个 javascript 幻灯片,现在在幻灯片处于活动状态的页面上,整个封闭的“body_section”div 被一直推到左侧。你自己看看:

http://sapaconstruction.com.au/sapa/

这是主页将所有内容浮动到左侧。现在在此页面上:

http://sapaconstruction.com.au/sapa/?page_id=4< /a>

一切看起来都很正常,所以它一定与 javascript 幻灯片有关。这是他们编写的 javascript 的样子(它嵌入在页面上)。

<script type="text/javascript" src="<?php bloginfo('template_url') ?>/js/compressed.js"></script>
    <script type="text/javascript">
    $('homeslideshow').style.display='none';
    $('wrapper').style.display='block';
    var homeslideshow=new TINY.slideshow("homeslideshow");
    window.onload=function(){
        homeslideshow.auto=true;
        homeslideshow.speed=5;
        homeslideshow.init("homeslideshow","image","imgprev","imgnext","imglink");
    }
    </script>

对于这个问题的任何帮助都会很棒,我已经绞尽脑汁尝试了几个小时的黑客攻击和边距修复以及类似的事情。

I have a very strange issue going on here. It's only occurring on Internet Explorer (what a surprise).

Basically I'm trying to fix a site that was given to me after some third-rate developers finished it and obviously did not test on IE.

They've setup a javascript slideshow, now on the pages with the slideshow active, the whole enclosing "body_section" div is being pushed all the way to the left. Have a look for yourselves:

http://sapaconstruction.com.au/sapa/

That's the homepage which floats everything to the left. Now on this page:

http://sapaconstruction.com.au/sapa/?page_id=4

Everything looks normal, so it must have something to do with the javascript slideshow. Here's what the javascript they've written looks like (it's embed on the page).

<script type="text/javascript" src="<?php bloginfo('template_url') ?>/js/compressed.js"></script>
    <script type="text/javascript">
    $('homeslideshow').style.display='none';
    $('wrapper').style.display='block';
    var homeslideshow=new TINY.slideshow("homeslideshow");
    window.onload=function(){
        homeslideshow.auto=true;
        homeslideshow.speed=5;
        homeslideshow.init("homeslideshow","image","imgprev","imgnext","imglink");
    }
    </script>

Any help with this issue would be amazing, I've wracked my brain for hours trying hacks and margin fixes and things like that.

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

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

发布评论

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

评论(1

梦开始←不甜 2024-12-16 20:01:37

好吧,我可以告诉你这一点。这个网站的问题远不止这些。查看源代码,在 html 节点之前有一个 div。我首先要解决这个问题,因为即使在 Firefox 中,这也会导致一些奇怪的事情发生。事实上,我认为这个“ieonly”div 是导致问题的原因,因为在 IE 中这个 div 成为了 body 中的包装器。建立这个网站的人对跨浏览器设计不太熟悉,并试图采用太多的 IE 黑客技术。

编辑:

问题是 IE 由于缺少文档类型而处于怪异模式。以下文档类型应该有效:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

Well, I can tell you this. This site has way more problems than just that. In looking at the source, there is a div that comes before the html node. I would first of all fix that, as even in firefox, this is causing some strange things to happen. As a matter of fact, I think this "ieonly" div is what is causing the issue, as in IE this div becomes the wrapper in the body. Whoever built this site was not very familiar with cross browser design, and tried to bake in way too many IE hacks.

EDIT:

The problem was IE was in quirks mode due to the lack of a doctype. The following doctype should work:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

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