Jump to content
  • 0

Проблема с javascript'ом в firefox


Kosty@n
 Share

Question

Народ, есть скрипт, передвигающий изображение на экране

<script type="text/javascript">

<!--

var doc=document;

function pereezd(photoGo,x0,y0,x1,y1){

pgo=photoGo;

count=0; //счетчик

x=x0; // x0,y0 - "нулевые" точки; x1,y1 - конечные точки

y=y0;

vremya=10; // время задержки(в принципе скорость)

step=500; // частота шага

stepX=(x1-x0)/step;

stepY=(y1-y0)/step;

moveto();

}

function moveto(){

if(count < step){

count++ ;

x += stepX;

y += stepY;

obg=doc.getElementById(pgo).style;

obg.left=x;

obg.top=y;

setTimeout("moveto()",vremya);

}

}

//-->

</script>

вот, как это описывается на странице

<div id="photo"><a class="welcome" onmouseover="pereezd('imgZador',220,69,550,69)" onmouseout="pereezd('imgZador',550,69,220,69)">"При наведении на текст..."</a><br/>

<div id="imgZador"><img id = "smimg" alt="Изображение" src ='images/image1.jpg' onclick = "changeimg()"></div>

</div>

вот css

#photo{

min-width:350px;

height:280px;

background: #e1e6f8;

padding: 0px 10px 10px 10px;

}

#imgZador{

position:absolute;

}

скрипт адекватно воспринимается оперой и ие, firefox игнорирует его...

буду благодарен за любую помощь. Заранее спасибо.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy