Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

164
Views
El evento al hacer clic no se abre en la misma pestaña/ventana en una imagen con zoom al pasar el mouse

Estoy tratando de abrir una página web en la misma pestaña/ventana al hacer clic en una imagen ampliada. Intenté _self pero no funciona. Además, estoy usando Google Sites para desarrollar un sitio web simple. Parece fácil, pero no obtengo la respuesta y no puedo resolver el problema. Adjuntando mi código.

 <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> * { box-sizing: border-box; } .zoom[href] { padding: 2px; transition: transform .3s; width: 150px; height: 81px; margin: 0 auto; overflow: hidden; } .zoom:hover { -ms-transform: scale(1.3); /* IE 9 */ -webkit-transform: scale(1.3); /* Safari 3-8 */ transform: scale(1.3); } ::-webkit-scrollbar { width: 0px; /* remove scrollbar space / background: transparent; / optional: just make scrollbar invisible / } / optional: show position indicator in red */ ::-webkit-scrollbar-thumb { background: #FF0000; } </style> <script type="text/javascript"> var windowObjectReference = null; // global variable function openRequestedPopup(url, windowName) { if(windowObjectReference == null || windowObjectReference.closed) { windowObjectReference = window.open(url, windowName, "_self"); } else { windowObjectReference.focus(); }; } </script> </head> <body> <div class="zoom"> <a href="https://www.google.com" onclick="openRequestedPopup(this.href, this.target); return false;"> <img src="https://via.placeholder.com/250" alt="Our Performance" styles="width:100%"> </a> </div> </body> </html>

Esta es mi situación actual: ingrese la descripción de la imagen aquí

Y esto es lo que estoy esperando:

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Tengo entendido que tiene la intención de abrir una ventana emergente dentro de su página cuando el usuario hace clic en ella. Esto se puede lograr de la siguiente manera:

1. Crea un marco flotante

Deberá crear un iframe como este:

 <iframe id="mypopup" style="display:none;"></iframe>

2. Crea una función que lo abra con una URL

 function openIFrame(url) { let myPopup = document.getElementById("mypopup"); mypopup.style.display = "block"; mypopup.src = url; }

3. Tener un onclick que lo ejecute

Algo como

 onclick="openIFrame(this.href); return false;"

en tu ancla.

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!