Foros del Web » Programando para Internet » Javascript »

Ventana nueva sin barras con boton der. mouse deshabilitado

Estas en el tema de Ventana nueva sin barras con boton der. mouse deshabilitado en el foro de Javascript en Foros del Web. Hola, mi consulta es la siguiente: En una página donde muestro varias fotos tengo el boton derecho del mouse deshabilitado con un script que funciona ...
  #1 (permalink)  
Antiguo 22/09/2005, 13:37
 
Fecha de Ingreso: enero-2002
Mensajes: 73
Antigüedad: 22 años, 4 meses
Puntos: 0
Pregunta Ventana nueva sin barras con boton der. mouse deshabilitado

Hola, mi consulta es la siguiente:
En una página donde muestro varias fotos tengo el boton derecho del mouse deshabilitado con un script que funciona perfecto.
En cada imagen hay un link que abre una ventana sin barras con un tamañp especifico de acuerdo a la imagen que se muestra.
Por ejemplo
<a href="#" onclick="window.open('fotografia_flores/flbn%200502.jpg','Flores','width=370,height=489')" ><img src="fotografia_flores/flbn%200502-2.jpg" width="100" height="133" border="0"></a>
El tema es que necesito deshabilitar el botón derecho del mouse en estas ventanas que abro, pero no se como.
¿Tendría que pasar este script para deshabiliar el boton derecho a través de otro script?
¿Hay alguna otra forma?
Muchas gracias, Erika.
  #2 (permalink)  
Antiguo 22/09/2005, 13:57
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
en vez de abrir la imagen directamente, abrela en una pagina y luego alli le pasas la variable o nombre de la imagen. en esta pagina finalmente pones el script que tienes pero ese script guardalo en un .js y adjuntalo a la pagina que tas abriendo.

has un include del script en cada pagina, por ejemplo:

Código HTML:
<script language="javascript" src="myscript.js"></script> 
y listo, si tienes 500's paginas solo tienes que modificar el script que estará dentro de myscript.js.

espero te sirva
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #3 (permalink)  
Antiguo 22/09/2005, 14:10
 
Fecha de Ingreso: enero-2002
Mensajes: 73
Antigüedad: 22 años, 4 meses
Puntos: 0
Saruman gracias por tu ayuda, pero como tendría que hacer para pasarle la variable de la foto?
  #4 (permalink)  
Antiguo 22/09/2005, 14:20
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
pregunta: eso lo estás trabjando en full html o en algun lenguaje de servidor (php,asp).
necesito sabeer esto para explicarte.
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #5 (permalink)  
Antiguo 22/09/2005, 14:42
 
Fecha de Ingreso: enero-2002
Mensajes: 73
Antigüedad: 22 años, 4 meses
Puntos: 0
Solo es html.
  #6 (permalink)  
Antiguo 22/09/2005, 15:18
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
ok, ya lo tengo.
copia y pega en tu editor html estos dos archivos por separado con sus nombres.

default.html
Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body> 
<a href="#" onclick="window.open('vistaprevia.html?imagen=miimagen.jpg','Flores','width=370,height=489')">IMAGEN</a>
</body>
</html> 
la variable "imagen" es la que contiene el nombre de la imagen que quieres mostrar... si no entiendes me avisas.

vistaprevia.html
Código HTML:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body onLoad="getImageName()"> 
<script language="javascript">
 function getImageName() {
  var main_url = "http://www.direccion.com/folder_imagenes/";
  var url = document.location;
  url = url.toString();
  var question_mark_position = url.indexOf("?imagen=");
  var nom_image = String(url).substring((question_mark_position+8), url.length);
  var img = document.getElementById("MiImagen");
  img.src = main_url + nom_image;
 }
 
 function click() {
  if (event.button == 2) {
   alert ("Imágenes y contenido, propiedad de Erika.");
  }
 }
 document.onmousedown = click;
</script>
<img id="MiImagen" border="0">
</body>
</html> 
y listo. no tienes que preocuparte por muchas paginas, solo envia el nombre de la imagen y listo.

espero te sirva.

saludos.
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #7 (permalink)  
Antiguo 23/09/2005, 12:25
 
Fecha de Ingreso: enero-2002
Mensajes: 73
Antigüedad: 22 años, 4 meses
Puntos: 0
Saruman es genial!
Creo haberlo entendido sin problemas, apenas llegue a mi PC lo voy a probar.
Muchisimas gracias.
  #8 (permalink)  
Antiguo 23/09/2005, 12:35
 
Fecha de Ingreso: enero-2002
Mensajes: 73
Antigüedad: 22 años, 4 meses
Puntos: 0
Saruman, funcionó 10 puntos con casi nada de trabajo.
Muchas gracias por tu ayuda!!
  #9 (permalink)  
Antiguo 23/09/2005, 15:04
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
ok, cool... me alegro
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #10 (permalink)  
Antiguo 11/10/2005, 13:36
 
Fecha de Ingreso: enero-2005
Mensajes: 28
Antigüedad: 19 años, 4 meses
Puntos: 0
Muchas gracias Saruman! Un maestro realmente, esto es lo que estaba buscando!!! Te hago una preguntita si no es mucha molestia. Si en vez de width=370,height=489 quiero que se abra la página entera, pero sin barras , qué medidas tendría que ponerle?

De nuevo GRACIAS!
  #11 (permalink)  
Antiguo 11/10/2005, 13:49
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
tendrias que capturar u obtener la medida de la resolución del cliente.
prueba con esto:

http://www.forosdelweb.com/showpost....15&postcount=2

espero te sirva
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #12 (permalink)  
Antiguo 12/10/2005, 04:01
 
Fecha de Ingreso: septiembre-2004
Mensajes: 179
Antigüedad: 19 años, 7 meses
Puntos: 0
Buenas,

con un simple Ctrl+U o Ctrl+N (según navegador) abres la misma ventana con botones y menús, miras el código fuente y sacas la ruta de la imagen. Pones esa ruta en navegador et voila! La foto pa' ti pa' siempre. Y este es el método largo. Hay uno con el que sólo necesitas pulsar una tecla :)

Cuanto esfuerzo echado a perder en algo que no funciona...
__________________
Estoy en www.aibarra.net

Camino para preguntar: manual -> Google -> FAQs y buscador del foro -> Nuevo Tema.
Tan difícil es escribir correctamente? Es más fácil leerlo. Pónselo fácil al que quiera ayudarte.
  #13 (permalink)  
Antiguo 12/10/2005, 08:50
 
Fecha de Ingreso: enero-2005
Mensajes: 28
Antigüedad: 19 años, 4 meses
Puntos: 0
Oye Saruman, si tengo como 20 thumbs, se puede ? xque lo hice con c/u de los thumbs y resulta que con el 1ero anduvo, pero los otros restantes abren el 2do, vaya a saber x que ..
Te paso el código a ver q hice mal ...

Código:
<h4>En estas p&aacute;ginas podr&aacute;s ver qui&eacute;nes componen el canal #Pueblito en DALnet ... <br>
      Haciendo click en cada foto podr&aacute;s conocer m&aacute;s de nosotros !!!
</h4>
    <p align="left"><a href="#" onclick="window.open('carol.html?imagen=tn_bebita2k.jpg','Bebita2K','width=900,height=800')"><img src="tn_bebita2k.jpg" width="150" height="148" border="0"></a><a href="#" onclick="window.open('blink.html?imagen=tn_blink_t.jpg','Blink T','width=900,height=800')"><img src="tn_blink_t.jpg" width="133" height="150"><img src="tn_carlos.jpg" width="116" height="150"><img src="tn_catirax.jpg" width="116" height="150"><img src="tn_eggman.jpg" width="108" height="150"><img src="tn_eli3.jpg" width="109" height="150"><br>
    <img src="tn_yunu001.jpg" width="120" height="150"><img src="tn_patty_garcia.jpg" width="111" height="150"><img src="tn_natalia.jpg" width="110" height="150"><img src="tn_mariag.jpg" width="143" height="150"><img src="tn_la_lokita.jpg" width="120" height="150"><img src="tn_ircman.jpg" width="97" height="150"><img src="tn_gittanna.jpg" width="110" height="150"></p>
    <p align="left"><img src="tn_tonicaluga.jpg" width="150" height="120"><img src="tn_sonicx.jpg" width="150" height="120"><img src="tn_pastrulo1.jpg" width="150" height="120"><img src="tn_nitro.jpg" width="150" height="120"><img src="tn_miguelnet.jpg" width="150" height="120"><br>
    <img src="tn_marissa.jpg" width="150" height="120"> <img src="tn_maribella.jpg" width="150" height="120"> <img src="tn_luis.jpg" width="150" height="120"><img src="tn_larry_.jpg" width="150" height="128"><img src="tn_hellstar.jpg" width="150" height="120"><br>
    <img src="tn_galletita.jpg" width="150" height="120"> <img src="tn_gabo.jpg" width="150" height="120"> <img src="tn_francisco.jpg" width="150" height="110"><img src="tn_enemy.jpg" width="150" height="128"><img src="tn_charly_cobain.jpg" width="150" height="122"></p>
    <p align="left"><a href="michelito.html" target="_self"><img src="tn_michelito.jpg" width="150" height="128" border="0"></a></p>
    <p align="center"><a href="http://www.imageshack.us" target="_blank"><img src="imageshack.gif" width="468" height="60" border="0"></a></p>
  </div>
O Sea el primero anda bien, el 2do tambien, pero el resto de los thumbs abre el blink.html ...

Por q hace eso?
  #14 (permalink)  
Antiguo 12/10/2005, 08:58
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
Cita:
Iniciado por Aibarra.net
Cuanto esfuerzo echado a perder en algo que no funciona...
digo, primero enterate de que se trata el tema y luego critica
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #15 (permalink)  
Antiguo 12/10/2005, 09:03
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
CaLy, te falto un "</a>"... intenta de nuevo.. aqui esta la linea donde está el error...

Código HTML:
<a href="#" onclick="window.open('blink.html?imagen=tn_blink_t.jpg','Blink T','width=900,height=800')"><img src="tn_blink_t.jpg" width="133" height="150" border="0"></a> 
saludos
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:24.