Quiero agregar el evento onclick en la etiqueta incrustada, pero el problema es que no funciona en Chrome y el controlador no funciona. Aparte del evento onclick mouseover y mouseleave están funcionando. Aquí está el código HTML
<embed src="http://localhost/credit-app1/" onclick="increaseSize()" onload="bottomRight()">JAVASCRIPT
function increaseSize(){ var embedtag = document.querySelector("embed"); if(embedtag.style.width == "400px"){ embedtag.style.width = "100px"; embedtag.style.height = "100px"; }else{ embedtag.style.width = "400px"; embedtag.style.height = "500px"; } console.log(embedtag) }podrías hacerlo con CSS puro usando el efecto de desplazamiento:
embed:hover { transform: scale(2.5); } No estoy seguro de cómo debería funcionar con onclick() , porque el contenido interior nunca tendrá el evento de clic...
O:
Podría intentar colocar un <div> transparente sobre el contenido incrustado:
<div style="height: 100px; width: 100px; position: absolute; top: 0; background-color: transparent;" onclick="increaseSize()"></div> <embed src="http://localhost/credit-app1/" onload="bottomRight()" style="position: relative;">en el JavaScript también necesita cambiar el tamaño del div.