悬停图像在FF& NN,但不是IE [英] Hover Images Work in FF & NN, but not IE

查看:61
本文介绍了悬停图像在FF& NN,但不是IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有四段代码来自动构建我的导航按钮并选择要加载的页面:1)悬停脚本,交换图像onmouseover和onmouseout,2)DOM加载器,自动创建和删除DOM元素, 3)导航脚本,根据正在查看的页面构建导航按钮,以及4)页面加载器脚本,清除内容区域并插入新选择的内容。


应该发生的是:NAVInit根据正在查看的页面选择要使用的图像,并将它们提交给DOMLoader以删除旧元素并创建新元素。 DOM创建过程的一部分包括属性''onmouseover =''和'onmouseout ='',它们启动HOVERLoader脚本以交换图像,以及''onclick =''属性,它调用PAGELoader脚本加载新内容并重置导航按钮。


这一切都适用于FF2.2.08和NN9,但是onmouseover,onmouseout和onclick在IE7中不起作用(再次与微软合作!) 。但是,IE7没有给出任何错误。


奇怪的是,我知道当手动创建DOM元素时,这三个属性都可以在IE7中运行。那么,这里发生了什么?我唯一能想到的就是我创造弦乐的方式。您将在我在NAVLoader脚本中使用的mouseOver和mouseOut变量中看到。


不确定您想要查看多少代码,但我会尝试仅包含相关部分。因为这里有很多代码,我会在这篇文章的单独回复中添加它们。


提前感谢您的反馈。

I have four pieces of code to automatically build my navigation buttons and choose which page to load: 1) a hover script, which swaps the images onmouseover and onmouseout, 2) a DOM loader, which automatically creates and removes DOM elements, 3) a nav script, which builds the nav buttons depending on the page being viewed, and 4) a page loader script that clears out the content area and inserts the newly selected content.

What should happen is this: NAVInit selects the images to use depending on the page being viewed, and submits them to the DOMLoader to remove the old elements and create the new elements. Part of the DOM creation process includes the attributes ''onmouseover='' and ''onmouseout='', which intiate the HOVERLoader script to swap out images, and an ''onclick='' attribute, which calls the PAGELoader script to load the new content and reset the nav buttons.

This all works in FF2.2.08 and NN9, but the onmouseover, onmouseout, and onclick do not work in IE7 (dang Microsoft again!). IE7 does not give any errors, however.

The strange thing is, I know that these three attributes all work in IE7 when the DOM Elements are created manually. So, what is going on here? The only thing that I can think of is in the way I create my strings. You''ll see in the mouseOver and mouseOut vars I use in the NAVLoader script.

Not sure how much of the code you want to see, but I will try to include only the relevant parts. Because there is so much code here, I will add them in separate replies to this post.

Thanks in advance for your feedback.

推荐答案

HOVERLoader脚本:

HOVERLoader script:

展开 | 选择 | Wrap | 行号


DOMLoader脚本:

DOMLoader script:

展开 | 选择 | Wrap < span class =codeDivider> | 行号


NAVLoader脚本:

NAVLoader script:

展开 | 选择 | Wrap | 行号


这篇关于悬停图像在FF&amp; NN,但不是IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆