firefox和opere不适用于鼠标悬停 [英] firefox and opere do not work on mouse over

查看:101
本文介绍了firefox和opere不适用于鼠标悬停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨大师


我有一个小的javascript在IE中完美运行(换一次),但是

在Firefox和Opera中不起作用(虽然没有错误)...


您可以在 www.tupelo.co.nz 将鼠标移动到大图像下方的小缩略图上




使其工作的脚本是:


函数CI(Alt,n){

if(letter){

ImgN =字母+ n;

if(document.getElementById&& document.getElementById(''LP'')){

OI(n);

var d = document.getElementById(''LP'');

if(document.createElement){

var i = document.createElement('' img'');

i.src =" i / L /" + ImgN +''.jpg'';

i.className =''Lpic'';

i.alt = Alt;

i.id =''LpicID'';

i.height =" 212";

while(d.firstChild!== null){

d.removeChild(d.firstChild);

}

d.appendChild(i);

返回true;

}

else if(d.innerHTML){

d.innerHTML =''< img src =" i / L /'' + ImgN +''.jpg" CLASS =" LPIC" alt ="''+ Alt +

''" ID = QUOT; LpicID" HEIGHT =" 212">'';

alert(''Nogo'');

返回true;

}

else {

返回false;}

}

else {

返回false; }

}

}

函数OI(麻木){

var imgID =''s''+麻木;

if(document.getElementById&& document.getElementById(imgID)){

var img = document.getElementById(imgID);

img.src =''i / S /''+ letter + numb +''o.jpg'';

返回true;

}

}

解决方案

在文章< 42 ******** @ clear.net.nz>,< a href =mailto:wi ********* @ coldmail.com> wi ********* @ coldmail.com 启发我们

用...

嗨大师

我有一个小的javascript在IE中完美运行(换一次),但
在Firefox和Opera中不起作用(虽然没有错误)...


在我的Fi工作refox。 FF 1.0

您使用的是什么版本?

始终包含浏览器版本。

您可以在 www.tupelo.co.nz 将鼠标移动到大尺寸下方的小缩略图上图片。




图像改变对我来说很好。

你怎么了?


-

-

~kaeli~

不要嘲笑Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


< blockquote> kaeli写道:

文章< 42 ******** @ clear.net.nz>, wi ********* @ coldmail.com
通过...

嗨大师

我有一个小的javascript在IE中完美运行(用于
更改),但在Firefox和Opera中不起作用(尽管没有错误)。 ..



在我的Firefox中工作。 FF 1.0
您使用的是什么版本?
始终包含浏览器版本。


您可以在 www.tupelo.co.nz 移动到大尺寸下方的小缩略图上图片。



图像改变了对我来说很好。
你发生了什么事?



大的改变但是小的那些(你移动鼠标)

也应该改变(减轻一点),对不起,似乎我遗漏了一些

的重要信息。


我使用Mozilla / 5.0(Windows; U; Windows NT 5.1; en-GB; rv:1.7.7)

Gecko / 20050414 Firefox / 1.0.3


干杯


windandwaves写道:

kaeli写道:

在文章中< 42 ******** @ clear.net.nz> ;, wi ***** ****@coldmail.com
启发我们...

嗨大师

我有一个在IE中完美运行的小javascript (对于
更改),但在Firefox和Opera中不起作用(尽管没有错误
)...


在我的Firefox中工作。 FF 1.0
您使用的是什么版本?
始终包含浏览器版本。


您可以在


你的nofollowhref =http://www.tupelo.co.nztarget =_ blank> www.tupelo.co.nz
将鼠标移到大图像下面的小缩略图上。



图像改变对我来说很好。
你怎么了?



大的改变但小的(你移动



鼠标)也应该改变(减轻一点),对不起,似乎我离开
了一些重要信息。

我使用Mozilla / 5.0(Windows; U; Windows NT 5.1; en-GB; rv:1.7.7)
Gecko / 20050414 Firefox / 1.0.3

干杯




你好w& w。


所有脚本都有什么用?请记住你们翻滚吗?仍然

效果很好。如果不必要的话,没有任何意义可以让DOM变得疯狂,特别是商业网站上的



另外:使用HTML /可以轻松完成''eq''事情CSS。更容易

也可以修改。替换它(在你的样式表中):


DIV #equa {height:20px; margin-bottom:7px;}


....用此:


DIV #equa {margin-bottom:7px;}

DIV.eq {width:15px;身高:15px;漂浮:对; margin-left:3px;

背景:#fff; }

DIV.eq-active {width:15px;身高:15px;漂浮:对; margin-left:

3px;背景:#f2cf77;然后:


< BODY ONLOAD =" loadimages();">

< DIV ID =" main">

< TABLE CELLSPACING =" 0" CELLPADDING = QUOT; 0" BORDER =" 0" ID =" logm">

< TR>

< TD ID =" logo">< IMG ID =" ilogo" SRC =" I / logo.gif" ALT =TUPELO BAR ///

惠灵顿最古老的休息室和鸡尾酒吧 TITLE =" TUPELO BAR ///

惠灵顿最古老的休息室和鸡尾酒吧">< / TD>

< TD ID =" menu">

< DIV ID =" equa">

< div id =" eq6" class =" eq">< / div>

< div id =" eq5" class =" eq">< / div>

< div id =" eq4" class =" eq">< / div>

< div id =" eq3" class =" eq">< / div>

< div id =" eq2" class =" eq">< / div>

< div id =" eq1"类= QUOT;当量" style =" background:#f29c01;">< / div>< / DIV>

< DIV ID =" menb">

关于& nbsp;

< A HREF =" gigs.php?PHPSESSID = d46e114f6b68a94a295fd0da9 b286f9d"

ONMOUSEOVER =" return doClass(2,''eq- active'');"

ONMOUSEOUT =" return doClass(2,''eq'');"> GIGS< / A> & nbsp;

< A HREF =" menu.php?PHPSESSID = d46e114f6b68a94a295fd0da9 b286f9d"

ONMOUSEOVER =" return doClass(3,''eq-active '');"

ONMOUSEOUT =" return doClass(3,''eq'');"> MENU< / A> & nbsp;

< A HREF =" drinks.php?PHPSESSID = d46e114f6b68a94a295fd0d a9b286f9d"

ONMOUSEOVER =" return doClass(4,''eq-active '');"

ONMOUSEOUT =" return doClass(4,''eq'');"> DRINKS< / A> & nbsp;

< A HREF =" functions.php?PHPSESSID = d46e114f6b68a94a295f d0da9b286f9d"

ONMOUSEOVER =" return doClass(5,''eq-active '');"

ONMOUSEOUT =" return doClass(5,''eq'');"> FUNCTIONS< / A> & nbsp;

< A HREF =" bookings.php?PHPSESSID = d46e114f6b68a94a295fd 0da9b286f9d"

ONMOUSEOVER =" return doClass(6,''eq-active '');"

ONMOUSEOUT =" return doClass(6,''eq'');"> CONTACTS< / A>

< / DIV>

< DIV ID =" mens">

< / DIV>

< / TD>

< / TR>

< / TABLE>

< TABLE CELLSPACING =" 0" CELLPADDING = QUOT; 0"边界=" 0" ID =" copy">

< TR>

< TD ID =" mail">

< FORM METHOD ="交" ACTION =" thankyou.php" ID =" frm">< input type =" hidden"

name =" PHPSESSID"值= QUOT; d46e114f6b68a94a295fd0da9b286f9d" />

< P ID =" join">加入图珀洛maling列表& nbsp;

< INPUT TYPE =" text" NAME ="电子邮件" ID =" email">

< INPUT TYPE =" submit" VALUE ="加入" CLASS = [提交" NAME =" join">

< / P>

< / FORM>

< / TD>

< TD ID =" head">

< H1>关于///< SPAN ID =" heex"> THE VENUE< / SPAN>< ; / H1>

< / TD>

< / TR>

< TR>

< TD ID =" picL">

< DIV ID =" LP">< IMG SRC =" i / L / exa.jpg" CLASS =" LPIC" ALT =大图片

TITLE =大图片 NAME =" LPIC" WIDTH =" 320" HEIGHT =" 215">< / DIV>

< IMG SRC =" i / S / i1n.jpg" NAME =" S1" CLASS ="穗" ALT =小图片

TITLE ="小图片

ONMOUSEOVER ="返回iRoll(''s1'',''i / S / i1o .jpg'',''Lpic'',''i / L / i1.jpg'');"

ONMOUSEOUT ="返回iRoll(''s1'',''我/S/i1n.jpg'');">

< IMG SRC =" i / S / i2n.jpg" NAME =" S2" CLASS ="穗" ALT =小图片

TITLE =小图片

ONMOUSEOVER ="返回iRoll(''s2'',''i / S / i2o .jpg'',''Lpic'',''i / L / i2.jpg'');"

ONMOUSEOUT ="返回iRoll(''s2'',''我/S/i2n.jpg'');">

< IMG SRC =" i / S / i3n.jpg" NAME =" S3" CLASS ="穗" ALT =小图片

TITLE =小图片

ONMOUSEOVER ="返回iRoll(''s3'',''i / S / i3o .jpg'','''Lpic'',''i / L / i3.jpg'');"

ONMOUSEOUT ="返回iRoll(''s3'',''我/S/i3n.jpg'');">

< IMG SRC =" i / S / i4n.jpg" NAME =" S4" CLASS ="穗" ALT =小图片

TITLE ="小图片

ONMOUSEOVER ="返回iRoll(''s4'',''i / S / i4o .jpg'',''Lpic'',''i / L / i4.jpg'');"

ONMOUSEOUT ="返回iRoll(''s4'',''我/S/i4n.jpg'');">

< IMG SRC =" i / S / i5n.jpg" NAME =" S5" CLASS ="穗" ALT =小图片

TITLE =小图片

ONMOUSEOVER ="返回iRoll(''s5'',''i / S / i5o .jpg'',''Lpic'',''i / L / i5.jpg'');"

ONMOUSEOUT ="返回iRoll(''s5'',''我/S/i5n.jpg'');">

< IMG SRC =" i / S / i6n.jpg" NAME =" S6" CLASS ="穗" ALT =小图片

TITLE =小图片

ONMOUSEOVER ="返回iRoll(''s6'',''i / S / i6o .jpg'',''Lpic'',''i / L / i6.jpg'');"

ONMOUSEOUT ="返回iRoll(''s6'',''我/S/i6n.jpg'');">

.........

.........

[格式化删除]


更改''j.js'' -


var pix = [

''i / S / i1o.jpg'',

''i / S / i2o.jpg'',

''i / S /i3o.jpg'',

''i / S / i4o.jpg'',

''i / S / i5o.jpg'',
''i / S / i6o.jpg'',

''i / L / i1.jpg'',

''i / L /i2.jpg'',

''i / L / i3.jpg'',

''i / L / i4.jpg'',
''i / L / i5.jpg'',

''i / L / i6.jpg''

];


函数loadimages()

{

for(var n,i = 0,l = pix.length; i< l; i ++ )<无线电通信/>
{

pix [(n = l + i)] = new Image();

pix [n] .src = pix [i] ;

}

}


功能iRoll()

{

for(var i = 0,l = arguments.length;我<升; i + = 2)

document.images [arguments [i]]。src = arguments [i + 1];

}


函数doClass(n,cname)

{

var el;

if(document.getElementById

&&(el = document.getElementById(''eq''+ n)))

{

el.className = cname;

}

返回true;

}


函数OW(fln){

...........

...........


干杯,Rob。


Hi Gurus

I have a little javascript that works perfectly in IE (for a change), but
does not work in Firefox and Opera (no errors though)...

You can see the script in action at www.tupelo.co.nz by moving your mouse
over the little thumbnails below the big image.

The script that makes it work is:

function CI(Alt, n) {
if(letter) {
ImgN = letter + n;
if( document.getElementById && document.getElementById(''LP'') ){
OI(n);
var d=document.getElementById(''LP'');
if(document.createElement){
var i=document.createElement(''img'');
i.src="i/L/" + ImgN + ''.jpg'';
i.className=''Lpic'';
i.alt=Alt;
i.id=''LpicID'';
i.height = "212";
while(d.firstChild!==null){
d.removeChild(d.firstChild);
}
d.appendChild(i);
return true;
}
else if(d.innerHTML){
d.innerHTML=''<img src="i/L/'' + ImgN + ''.jpg" CLASS="Lpic" alt="'' + Alt +
''" ID="LpicID" HEIGHT="212">'';
alert(''Nogo'');
return true;
}
else {
return false;}
}
else {
return false;}
}
}
function OI(numb) {
var imgID = ''s'' + numb;
if (document.getElementById && document.getElementById(imgID)) {
var img = document.getElementById(imgID);
img.src = ''i/S/'' + letter + numb + ''o.jpg'';
return true;
}
}

解决方案

In article <42********@clear.net.nz>, wi*********@coldmail.com enlightened us
with...

Hi Gurus

I have a little javascript that works perfectly in IE (for a change), but
does not work in Firefox and Opera (no errors though)...
Worked in my Firefox. FF 1.0
What version are you using?
Always include versions for browsers.

You can see the script in action at www.tupelo.co.nz by moving your mouse
over the little thumbnails below the big image.



The images changed just fine for me.
What happened for you?

--
--
~kaeli~
Do not taunt Happy Fun Ball!
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


kaeli wrote:

In article <42********@clear.net.nz>, wi*********@coldmail.com
enlightened us with...

Hi Gurus

I have a little javascript that works perfectly in IE (for a
change), but does not work in Firefox and Opera (no errors though)...



Worked in my Firefox. FF 1.0
What version are you using?
Always include versions for browsers.


You can see the script in action at www.tupelo.co.nz by moving your
mouse over the little thumbnails below the big image.



The images changed just fine for me.
What happened for you?


The big ones changed but the little ones (over which you move the mouse)
should also change (lighten a little), sorry, it seems that I left out some
important info.

I use Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.7)
Gecko/20050414 Firefox/1.0.3

Cheers


windandwaves wrote:

kaeli wrote:

In article <42********@clear.net.nz>, wi*********@coldmail.com
enlightened us with...

Hi Gurus

I have a little javascript that works perfectly in IE (for a
change), but does not work in Firefox and Opera (no errors though)...


Worked in my Firefox. FF 1.0
What version are you using?
Always include versions for browsers.


You can see the script in action at www.tupelo.co.nz by moving

your mouse over the little thumbnails below the big image.



The images changed just fine for me.
What happened for you?


The big ones changed but the little ones (over which you move the


mouse) should also change (lighten a little), sorry, it seems that I left out some important info.

I use Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.7.7)
Gecko/20050414 Firefox/1.0.3

Cheers



Hi w&w.

What''s with all that scripting? Remember "ye olde rollover"? Still
works pretty well. No sense going DOM-crazy if unnecessary, particular
ona commercial site.

Also: that ''eq'' thing can be done easily with HTML/CSS. Easier to
modify as well. Replace this (in your stylesheet):

DIV#equa { height: 20px; margin-bottom: 7px;}

....with this:

DIV#equa { margin-bottom: 7px;}
DIV.eq { width: 15px; height: 15px; float: right; margin-left: 3px;
background: #fff; }
DIV.eq-active { width: 15px; height: 15px; float: right; margin-left:
3px; background: #f2cf77; }

Then:

<BODY ONLOAD="loadimages();">
<DIV ID="main">
<TABLE CELLSPACING="0" CELLPADDING="0" BORDER="0" ID="logm">
<TR>
<TD ID="logo"><IMG ID="ilogo" SRC="i/logo.gif" ALT="TUPELO BAR ///
Wellington oldest lounge and cocktail bar" TITLE="TUPELO BAR ///
Wellington oldest lounge and cocktail bar"></TD>
<TD ID="menu">
<DIV ID="equa">
<div id="eq6" class="eq"></div>
<div id="eq5" class="eq"></div>
<div id="eq4" class="eq"></div>
<div id="eq3" class="eq"></div>
<div id="eq2" class="eq"></div>
<div id="eq1" class="eq" style="background:#f29c01;"></div></DIV>
<DIV ID="menb">
ABOUT &nbsp;
<A HREF="gigs.php?PHPSESSID=d46e114f6b68a94a295fd0da9 b286f9d"
ONMOUSEOVER="return doClass(2,''eq-active'');"
ONMOUSEOUT="return doClass(2,''eq'');">GIGS</A> &nbsp;
<A HREF="menu.php?PHPSESSID=d46e114f6b68a94a295fd0da9 b286f9d"
ONMOUSEOVER="return doClass(3,''eq-active'');"
ONMOUSEOUT="return doClass(3,''eq'');">MENU</A> &nbsp;
<A HREF="drinks.php?PHPSESSID=d46e114f6b68a94a295fd0d a9b286f9d"
ONMOUSEOVER="return doClass(4,''eq-active'');"
ONMOUSEOUT="return doClass(4,''eq'');">DRINKS</A> &nbsp;
<A HREF="functions.php?PHPSESSID=d46e114f6b68a94a295f d0da9b286f9d"
ONMOUSEOVER="return doClass(5,''eq-active'');"
ONMOUSEOUT="return doClass(5,''eq'');">FUNCTIONS</A> &nbsp;
<A HREF="bookings.php?PHPSESSID=d46e114f6b68a94a295fd 0da9b286f9d"
ONMOUSEOVER="return doClass(6,''eq-active'');"
ONMOUSEOUT="return doClass(6,''eq'');">CONTACTS</A>
</DIV>
<DIV ID="mens">
</DIV>
</TD>
</TR>
</TABLE>
<TABLE CELLSPACING="0" CELLPADDING="0" Border="0" ID="copy">
<TR>
<TD ID="mail">
<FORM METHOD="post" ACTION="thankyou.php" ID="frm"><input type="hidden"
name="PHPSESSID" value="d46e114f6b68a94a295fd0da9b286f9d" />
<P ID="join">Join the Tupelo maling list &nbsp;
<INPUT TYPE="text" NAME="email" ID="email">
<INPUT TYPE="submit" VALUE="join" CLASS="submit" NAME="join">
</P>
</FORM>
</TD>
<TD ID="head">
<H1>ABOUT /// <SPAN ID="heex">THE VENUE</SPAN></H1>
</TD>
</TR>
<TR>
<TD ID="picL">
<DIV ID="LP"><IMG SRC="i/L/exa.jpg" CLASS="Lpic" ALT="large pic"
TITLE="large pic" NAME="Lpic" WIDTH="320" HEIGHT="215"></DIV>
<IMG SRC="i/S/i1n.jpg" NAME="s1" CLASS="Spic" ALT="small pic"
TITLE="small pic"
ONMOUSEOVER="return iRoll(''s1'',''i/S/i1o.jpg'',''Lpic'',''i/L/i1.jpg'');"
ONMOUSEOUT="return iRoll(''s1'',''i/S/i1n.jpg'');">
<IMG SRC="i/S/i2n.jpg" NAME="s2" CLASS="Spic" ALT="small pic"
TITLE="small pic"
ONMOUSEOVER="return iRoll(''s2'',''i/S/i2o.jpg'',''Lpic'',''i/L/i2.jpg'');"
ONMOUSEOUT="return iRoll(''s2'',''i/S/i2n.jpg'');">
<IMG SRC="i/S/i3n.jpg" NAME="s3" CLASS="Spic" ALT="small pic"
TITLE="small pic"
ONMOUSEOVER="return iRoll(''s3'',''i/S/i3o.jpg'',''Lpic'',''i/L/i3.jpg'');"
ONMOUSEOUT="return iRoll(''s3'',''i/S/i3n.jpg'');">
<IMG SRC="i/S/i4n.jpg" NAME="s4" CLASS="Spic" ALT="small pic"
TITLE="small pic"
ONMOUSEOVER="return iRoll(''s4'',''i/S/i4o.jpg'',''Lpic'',''i/L/i4.jpg'');"
ONMOUSEOUT="return iRoll(''s4'',''i/S/i4n.jpg'');">
<IMG SRC="i/S/i5n.jpg" NAME="s5" CLASS="Spic" ALT="small pic"
TITLE="small pic"
ONMOUSEOVER="return iRoll(''s5'',''i/S/i5o.jpg'',''Lpic'',''i/L/i5.jpg'');"
ONMOUSEOUT="return iRoll(''s5'',''i/S/i5n.jpg'');">
<IMG SRC="i/S/i6n.jpg" NAME="s6" CLASS="Spic" ALT="small pic"
TITLE="small pic"
ONMOUSEOVER="return iRoll(''s6'',''i/S/i6o.jpg'',''Lpic'',''i/L/i6.jpg'');"
ONMOUSEOUT="return iRoll(''s6'',''i/S/i6n.jpg'');">
.........
.........
[formatting removed]

Change ''j.js'' -

var pix = [
''i/S/i1o.jpg'' ,
''i/S/i2o.jpg'' ,
''i/S/i3o.jpg'' ,
''i/S/i4o.jpg'' ,
''i/S/i5o.jpg'' ,
''i/S/i6o.jpg'' ,
''i/L/i1.jpg'' ,
''i/L/i2.jpg'' ,
''i/L/i3.jpg'' ,
''i/L/i4.jpg'' ,
''i/L/i5.jpg'' ,
''i/L/i6.jpg''
];

function loadimages()
{
for (var n, i = 0, l = pix.length; i < l; i++)
{
pix[(n = l + i)] = new Image();
pix[n].src = pix[i];
}
}

function iRoll()
{
for (var i = 0, l = arguments.length; i < l; i += 2)
document.images[arguments[i]].src = arguments[i + 1];
}

function doClass(n, cname)
{
var el;
if (document.getElementById
&& (el = document.getElementById(''eq'' + n)))
{
el.className = cname;
}
return true;
}

function OW(fln){
...........
...........

Cheers, Rob.


这篇关于firefox和opere不适用于鼠标悬停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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