Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/07/2007, 12:42
Avatar de Ugho
Ugho
 
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago, Chile
Mensajes: 487
Antigüedad: 22 años, 2 meses
Puntos: 0
Dibujar rectangulo ONMOUSEOVER...

Estimados amigos:
encontre este codigo en internet y me parece bueno para lo que necesito...solo que existe un pequeño problema funciona en Internet Explorer pero...no funciona con FIREFOX. Cuando se agranda el rectangulo ningun problema pero cuando se achica no funciona...este es el código ...algun amigo puede ayudarme a arreglar este código???... por favor:
Código PHP:
 <HTML>
<
HEAD>
<
META http-equiv=imagetoolbar content=no>
<
TITLE>

</
TITLE>
<
STYLE>
#rubberBand {
positionabsolute;
visibilityhidden;
width0pxheight0px;
border2px dashed red;
}
</
STYLE>

</
HEAD>
<
BODY>
<
img name="myImage" id="myImage" src="myimage.gif" height=400
width
=400>


<
DIV ID="rubberBand"></DIV>

<
SCRIPT>

var 
IMG;

function 
startRubber (evt) {
if (
document.all) {
// IE
var document.all.rubberBand;
r.style.width 0;
r.style.height 0;
r.style.pixelLeft event.x;
r.style.pixelTop  event.y;
r.style.visibility 'visible';
IMG.ondragstart cancelDragDrop// otherwise IE will try to drag
the image
}
else if (
document.getElementById) {
// firefox
var document.getElementById('rubberBand');
r.style.width 0;
r.style.height 0;
r.style.left evt.clientX 'px';
r.style.top evt.clientY 'px';
r.style.visibility 'visible';
}
IMG.onmousemove moveRubber;
}
function 
moveRubber (evt) {
if (
document.all) { // IE
var document.all.rubberBand;
r.style.width event.r.style.pixelLeft;
r.style.height event.r.style.pixelTop;
}
else if (
document.getElementById) { // firefox
var document.getElementById('rubberBand');
r.style.width evt.clientX parseInt(r.style.left);
r.style.height evt.clientY parseInt(r.style.top);
}
return 
false// otherwise IE won't fire mouseup :/
}
function 
stopRubber (evt) {
IMG.onmousemove null;
}

function 
cancelDragDrop()
{
window.event.returnValue false;
}

IMG document.getElementById('myImage');
IMG.onmousedown startRubber;
IMG.onmouseup stopRubber;

</SCRIPT>
</BODY>
</HTML> 
De antemano muchas gracias...
__________________
________________________________________

Ugho.

Última edición por Ugho; 01/07/2007 a las 12:53 Razón: Dibujar rectangulo ONMOUSEMOVE...