473,508 Members | 2,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Moving an image

The URL is:
http://mapage.noos.fr/dardelf3/tintin/ListeAutos.html
The JS is in the header

This page behaves as follows:
Safari (Mac) OK
MSIE (Mac) OK
MSIE 5.0 (PC) OK (on Virtual PC on the Mac)
MSIE 5.1 (PC) No on my office PC (chgImg works, but MoveDIV doesn't)
FireFox (Mac) No (chgImg works, but MoveDIV doesn't)
iCab (Mac) No (chgImg works, but MoveDIV doesn't)

The faulty function is:

function moveDIV() {
// moves the picture in a new position...
mouseY=document.body.scrollTop+50;
// Gets the scroll position and positions the DIV 50 px below top
autoDIV.style.pixelTop = mouseY;
}

I've spent 3 days experimenting and searching examples on the web, but
I still found no solution.

Can anyone give me a solution ?

Many thanks in advance.

--
François de Dardel
http:/mapage.noos.fr/dardelf/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jul 23 '05 #1
3 2552

François de Dardel wrote:
The URL is:
http://mapage.noos.fr/dardelf3/tintin/ListeAutos.html
The JS is in the header

This page behaves as follows:
Safari (Mac) OK
MSIE (Mac) OK
MSIE 5.0 (PC) OK (on Virtual PC on the Mac)
MSIE 5.1 (PC) No on my office PC (chgImg works, but MoveDIV doesn't)
FireFox (Mac) No (chgImg works, but MoveDIV doesn't)
iCab (Mac) No (chgImg works, but MoveDIV doesn't)

The faulty function is:

function moveDIV() {
// moves the picture in a new position...
mouseY=document.body.scrollTop+50;
// Gets the scroll position and positions the DIV 50 px below top
autoDIV.style.pixelTop = mouseY;
}

I've spent 3 days experimenting and searching examples on the web, but I still found no solution.

Can anyone give me a solution ?

Many thanks in advance.

--
François de Dardel
http:/mapage.noos.fr/dardelf/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail


With some help from ppk:

function moveDIV()
{
// moves the picture in a new position...
var y_scroll, el;
if (self.pageYOffset)
// all except Explorer
y_scroll = self.pageYOffset;
else if (document.documentElement &&
document.documentElement.scrollTop)
// Explorer 6 Strict
y_scroll = document.documentElement.scrollTop;
else if (document.body) // all other Explorers
y_scroll = document.body.scrollTop;
// Gets the scroll position and positions the DIV 50 px below top
if ((document.getElementById
&& (el = document.getElementById('autoDIV')))
|| (document.all
&& (el = document.all['autoDIV'])))
{
el.style.top = String(y_scroll + 55 + 'px');
}
}

Might want to move that graphic into an 'alley' (clear left column) so
it doesn't obstruct any links when it moves down.

http://www.quirksmode.org/viewport/compatibility.html

Jul 23 '05 #2
RobB wrote:
François de Dardel wrote:
The URL is:
http://mapage.noos.fr/dardelf3/tintin/ListeAutos.html
The JS is in the header

This page behaves as follows:
Safari (Mac) OK
MSIE (Mac) OK
MSIE 5.0 (PC) OK (on Virtual PC on the Mac)
MSIE 5.1 (PC) No on my office PC (chgImg works, but MoveDIV doesn't) FireFox (Mac) No (chgImg works, but MoveDIV doesn't)
iCab (Mac) No (chgImg works, but MoveDIV doesn't)

The faulty function is:

function moveDIV() {
// moves the picture in a new position...
mouseY=document.body.scrollTop+50;
// Gets the scroll position and positions the DIV 50 px below top
autoDIV.style.pixelTop = mouseY;
}

I've spent 3 days experimenting and searching examples on the web,

but
I still found no solution.

Can anyone give me a solution ?

Many thanks in advance.

--
François de Dardel
http:/mapage.noos.fr/dardelf/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail


(snip)

Just a rough example...

Paste in this HTML:

<BODY BGCOLOR="#FFFFFF">
<DIV ID="autoDIV"
STYLE="position:absolute;left:2px;top:102px;width: 120px;border:1px
black solid;">
<A HREF="#" onClick="chgImg('rien.gif')"><IMG SRC="5CV_s.jpg"
NAME="slideshow" WIDTH=120 HEIGHT=80 BORDER=0></A></DIV>
<A HREF="http://mapage.noos.fr/dardelf/index.html" TITLE="FD home"
onMouseOver="changeIt('FD2', '../images/Blason7on.gif')"
onMouseOut="changeIt('FD2', '../images/Blason7.gif')"><IMG
SRC="../images/Blason7.gif" NAME="FD2" ALT="To
Fran&ccedil;ois´ homepage" BORDER="0" ALIGN="left"></A>
<TABLE SUMMARY="Liste" BORDER="0" CELLSPACING="0" CELLPADDING="2"
ALIGN="center" WIDTH="80%">
<TR>
<TD ROWSPAN=999 WIDTH=1></TD>
<TD COLSPAN=3 CLASS="grandbleu">Les autos de Tintin</TD>
<TD ALIGN="right" CLASS="bleu" COLSPAN=2><B>A list of all Tintin
cars</B></TD>
</TR>
............
............
....and this JS (replaces Load_Image, chgImg, moveDIV):

<script type="text/javascript">

function chgImg(myImg)
{
document.slideshow.src = myImg;
}

function moveDIV(e)
{
var y_mouse, y_scroll, el, picHt = 80, adj = 2;
if (e = e || window.event)
{
if ('undefined' != typeof e.clientY)
y_mouse = e.clientY < picHt ? picHt : e.clientY;
else if ('undefined' != typeof e.pageY)
y_mouse = e.pageY < picHt ? picHt : e.pageY;
if (y_mouse)
{
if (self.pageYOffset)
y_scroll = self.pageYOffset;
else if (document.documentElement &&
document.documentElement.scrollTop)
y_scroll = document.documentElement.scrollTop;
else if (document.body)
y_scroll = document.body.scrollTop;
if ((document.getElementById
&& (el = document.getElementById('autoDIV')))
|| (document.all
&& (el = document.all['autoDIV'])))
{
el.style.top = y_mouse + y_scroll + adj - picHt + 'px';
}
}
}
}

</script>

And: change *all* of these -

onMouseOver="moveDIV();

....to:

onMouseOver="moveDIV(event);

Jul 23 '05 #3
On 2005-04-26 04:31:33 +0200, "RobB" <fe******@hotmail.com> said:

Fran=E7ois de Dardel wrote:
The URL is:
http://mapage.noos.fr/dardelf3/tintin/ListeAutos.html
The JS is in the header

This page behaves as follows:
Safari (Mac) OK
MSIE (Mac) OK
MSIE 5.0 (PC) OK (on Virtual PC on the Mac)
MSIE 5.1 (PC) No on my office PC (chgImg works, but MoveDIV doesn't)
FireFox (Mac) No (chgImg works, but MoveDIV doesn't)
iCab (Mac) No (chgImg works, but MoveDIV doesn't)

The faulty function is:

function moveDIV() {
// moves the picture in a new position...
mouseY=3Ddocument.body.scrollTop+50;
// Gets the scroll position and positions the DIV 50 px below top
autoDIV.style.pixelTop =3D mouseY;
}
With some help from ppk:

function moveDIV()
{
// moves the picture in a new position...
var y_scroll, el;
if (self.pageYOffset)
// all except Explorer
y_scroll =3D self.pageYOffset;
else if (document.documentElement &&
document.documentElement.scrollTop)
// Explorer 6 Strict
y_scroll =3D document.documentElement.scrollTop;
else if (document.body) // all other Explorers
y_scroll =3D document.body.scrollTop;
// Gets the scroll position and positions the DIV 50 px below top
if ((document.getElementById
&& (el =3D document.getElementById('autoDIV')))
|| (document.all
&& (el =3D document.all['autoDIV'])))
{
el.style.top =3D String(y_scroll + 55 + 'px');
}
}

http://www.quirksmode.org/viewport/compatibility.html

Many thanks, will experiment will this. The reference is particularly useful.
--
François de Dardel
http:/mapage.noos.fr/dardelf/
Faber est suae quisque fortunae
Enlever le quatorze pour m'écrire
Remove fourteen in the address to send mail

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
9360
by: Diogo Alves - Software Developer | last post by:
Greetings I would like to knowhow can I put a sliding panel... I've done this: if (panel1.Width < 300) { while (panel1.Width < 300) { panel1.Width = panel1.Width + 40;
10
6736
by: cjparis | last post by:
Hello everyone. If anyone can give me a hand I would be gratefull Am doing a site which requires a moving element and have used DHTML to do it. Have a simple Browser detect script to sort IE...
1
3778
by: rsteph | last post by:
I bought a book to help me learn to use DirectX with windows programming. It's first trying to walk me through some basic windows programming and graphics before getting into DirectX. I'm trying to...
9
2967
by: Peter Webb | last post by:
I want to animate one object moving in front of another. I cannot re-render the background as the object moves, as it would be extremely time consuming. This is what I would like to do. I draw...
0
1642
by: linkswanted | last post by:
http://www.movingcompanies.co.il/supplies/boxes.html http://www.movingcompanies.co.il/residental/ http://www.movingcompanies.co.il/commercial/corporate-moves.html...
0
1829
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
0
1764
by: linkswanted | last post by:
We are your trusted source. World Moving & Storage is bonded and licensed by the U.S. Department of Transportation and is one of the largest residential moving and corporate relocation company in...
3
2849
by: ramesh1210 | last post by:
Hi all, Actually my requirement is to place an image in the text box and it should stand over the data in the text box. And i made it as ...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7133
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7405
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4724
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.