5568 sujets

Sémantique web et HTML

bonjour je suis en train de construire un site pour mon boulot, j ai donc trouver un code html pour faire un effet de zoom sur une pieces usiné maos le probleme c est qu il n est pas compatible firefox.
pourriez vous m aider a resoudre ce probleme merci.


le lien a tester sur firefox et IE http://vinceboy1.free.fr/zoom2/

le code
<style type="text/css">
#mglass {position:absolute;left:-2000;top:50;}
#thumb {position:absolute;left:-2000;top:50;}
#large {position:absolute;left:-2000;top:50;}
#framegif {position:absolute;left:-2000;top:50;}
.baseline {
position:absolute;
left:50px;
top:260px;
font-family:Arial;
font-size:9pt;
color:000000;
}
body {
	background-color: #999999;
}
.Style4 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 16px;
}
</style>

<script language="JavaScript">
<!-- Beginning of JavaScript -

// Magnifying-glass-script by Peter Gehrig and Urs Dudli 
//  http://www.24fun.ch,  info@24fun.ch, 11/23/1999

// Script trouvé sur Le Webmestre.net  www.le-webmestre.net  info@le-webmestre.net
// Retrouvez des centaines de scripts et bien plus...

var isNav, isIE
var offsetX, offsetY
var selectedObj 

var enlargefactor=5

var largewidth = 910
var largeheight = 1046
var largeleft =500
var largetop =60

var thumbwidth = Math.floor(largewidth/enlargefactor)
var thumbheight = Math.floor(largeheight/enlargefactor)
var thumbleft = 60
var thumbtop = 120

var mglasswidth = 65
var mglassheight = 65
var mglassleft = 140
var mglasstop = 300

var difleft= largeleft-thumbleft
var diftop= largetop-thumbtop

var clippoints

var cliptop = (thumbheight-mglassheight)*enlargefactor
var clipbottom = cliptop+(mglassheight*enlargefactor)
var clipleft =(thumbwidth-mglasswidth)*enlargefactor
var clipright = clipleft+(mglasswidth*enlargefactor)


if (parseInt(navigator.appVersion) >= 4) {
if (navigator.appName == "Netscape") {
isNav = true
} else {
isIE = true
}
}

function setZIndex(obj, zOrder) {
obj.zIndex = zOrder
}

function shiftTo(obj, x, y) {
if (isNav) {
obj.moveTo(x,y)
} else {
obj.pixelLeft = x
obj.pixelTop = y
} 
cliptop = (y-thumbtop)*enlargefactor
clipbottom = cliptop+(mglassheight*enlargefactor)
clipleft = (x-thumbleft)*enlargefactor
clipright = clipleft+(mglasswidth*enlargefactor)


if (document.all) {
clippoints ="rect("+cliptop+" "+clipright+" "+clipbottom+" "+clipleft+")"
document.all.large.style.posTop=largetop-cliptop
document.all.large.style.posLeft=largeleft-clipleft
document.all.large.style.clip=clippoints
}
if (document.layers) {
document.large.top=largetop-cliptop
document.large.left=largeleft-clipleft
document.large.clip.left = clipleft
document.large.clip.right = clipright
document.large.clip.top = cliptop
document.large.clip.bottom = clipbottom
}
}

function setSelectedElem(evt) {
if (isNav) {
var testObj
var clickX = evt.pageX
var clickY = evt.pageY
for (var i = document.layers.length - 1; i >= 0; i--) {
testObj = document.layers[i]
if ((clickX > testObj.left) && 
(clickX < testObj.left + testObj.clip.width) && 
(clickY > testObj.top) && 
(clickY < testObj.top + testObj.clip.height)) {
selectedObj = testObj
setZIndex(selectedObj, 100)
return
}
}
} else {
var imgObj = window.event.srcElement
if (imgObj.parentElement.id.indexOf("mglass") != -1) {
selectedObj = imgObj.parentElement.style
setZIndex(selectedObj,100)
return
}
}
selectedObj = null
return
}

function dragIt(evt) {
if (selectedObj) {
if (isNav) {
shiftTo(selectedObj, (evt.pageX - offsetX), (evt.pageY - offsetY))
} else {
shiftTo(selectedObj, (window.event.clientX - offsetX), (window.event.clientY - offsetY))
return false
}
}
}

function engage(evt) {
setSelectedElem(evt)
if (selectedObj) {
if (isNav) {
offsetX = evt.pageX - selectedObj.left
offsetY = evt.pageY - selectedObj.top
} else {
offsetX = window.event.offsetX
offsetY = window.event.offsetY
}
}
return false
}

function release(evt) {
if (selectedObj) {
setZIndex(selectedObj, 0)
selectedObj = null
}
}

function setNavEventCapture() {
if (isNav) {
document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
}
}

function init() {

if (document.layers) {
document.large.left=largeleft
document.large.top=largetop

document.framegif.left=largeleft-3
document.framegif.top=largetop-3

document.thumb.left=thumbleft
document.thumb.top=thumbtop

document.mglass.left=mglassleft
document.mglass.top=mglasstop

document.large.clip.left = 0
document.large.clip.right = 0
document.large.clip.top = 0
document.large.clip.bottom = 0

setNavEventCapture()
}

if (document.all) {
document.all.large.style.posLeft=largeleft
document.all.large.style.posTop=largetop

document.all.framegif.style.posLeft=largeleft-3
document.all.framegif.style.posTop=largetop-3

document.all.thumb.style.posLeft=thumbleft
document.all.thumb.style.posTop=thumbtop

document.all.mglass.style.posLeft=mglassleft
document.all.mglass.style.posTop=mglasstop
document.all.large.style.clip="rect(0 0 0 0)"
}

document.onmousedown = engage
document.onmousemove = dragIt
document.onmouseup = release
}
// - End of JavaScript - -->
</script> 

<BODY onLoad="init()" >
<p class="Style4">Vous pouvez d&eacute;placer la loupe....</p>
<div id="thumb"><img name="thumbpic" src="/images/micromecanique/loupe_jeux.jpg" width=200></div>
<div id="framegif"><img name="framepic" src="/JEUX/frame2311.gif"></div>
<div id="large"><img name="largepic" src="/images/micromecanique/loupe_jeux.jpg" width=1150></div>
<div id="mglass"><img name="mglasspic" src="/JEUX/mglass1.gif"></div> 
</p>
</p>
</p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="172" height="22" align="absbottom">
  <param name="BGCOLOR" value="#999999">
  <param name="movie" value="/FLASH/button2.swf">
  <param name="quality" value="high">
  <embed src="/FLASH/button2.swf" width="172" height="22" align="absbottom" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" bgcolor="#999999" ></embed>
</object>
</BODY>




merci beaucoup[/i]
Modifié par vinceboy (01 Feb 2007 - 09:36)
Bonjour et bienvenue sur le Forum Smiley smile

Un rapide coup d'œil à ta page permets de constater que tu as un très gros problème de structure... Smiley confus
Juge plutôt :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Acceuil</title>
</head>

<body>
</body>
</html>
<style type="text/css">
...
<BODY onLoad="init()" >
</BODY>


Il me semble que tu devrais reprendre les bases de la conception HTML. Smiley murf
Voici une page de ressources qui devrait t'aider : Comment débuter avec XHTML et les CSS ? Que sont les standards web ?

Bonne lecture Smiley cligne