Div with hide and iframe inside, however link does not open

0

When you enter the site , you will see that you will have a div by following the mouse, and the content of it is an iframe. When they click on this div or the image of the iframe, they disappear, however, the main objective is to click on the link inside the iframe, but clicking does not enter the link, that is, hide is working, but the link does not work. I do not know if I express myself well, you can feel free to correct my words.

The script used to hide the div is here .

The "follow mouse" script I'm using is the following code:

HTML:

<div id="position">
  <iframe style="border:none;  width:680px; height:250px;" frameborder="0" scrolling="No" src="http://saudeonline.info/anuncio/index.html"></iframe></div>

CSS:

#position{position:absolute;z-index:999999;}

JavaScript:

if(document.all){}elsedocument.captureEvents(Event.MOUSEMOVE);document.onmousemove=mouse;functionmouse(e){if(navigator.appName=='Netscape'){xcurs=e.pageX;ycurs=e.pageY;}else{xcurs=event.clientX;ycurs=event.clientY;}document.getElementById('position').style.left=(xcurs-530)+'px';document.getElementById('position').style.top=(ycurs-60)+'px';}

Whenyouenterthe site , you will see the ArgoConstrutora logo banner and the image link in the status bar, but when you click, do not go to the site, the div date.

    
asked by anonymous 07.03.2016 / 06:32

1 answer

0

I think the problem is in your iframe code. If you click on a link within an iframe the default behavior and open the new window inside the iframe itself (which you just hid). To solve this you can try to put a target="_blank" in the link which instructs the browser to open the link in a new page.  would look like this:

<a target="_blank" href="http://www.argoconstrutora.com.br/"><img src="img/anuncie.jpg" width="680" height="250" alt=""></a>

Having said this, this behavior of forcing the user to click on the ad and force the appearance of a new window is considered bad and will probably only serve to drive visitors away from your site.

    
07.03.2016 / 19:58