How do I make this iframe clickable?

Discussion in 'JavaScript' started by saadhu, Nov 3, 2011.

  1. #1
    I have a javascript based slider banner, part of which looks like the following example:
    htmlstring="<iframe src=\"http://example.com/banner.jpg\" name=\"adpiframe\" id=\"adpiframe\" width=100% height=100% align=\"center\" Frameborder=\"0\" Scrolling=\"no\" marginheight=\"0\" marginwidth=\"0\"></iframe>"
    new adp("template01",htmlstring,"blah blah");
    adpTimer('template01','adpSlidein','show','','',3,'');
    It shows a banner allright as expected but how can I insert some code to make banner.jpg clickable?
    Any ideas?
     
    saadhu, Nov 3, 2011 IP
  2. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #2
    you need to edit the page that the iframe calls..

    if you dont have access to that..

    you may put an overlay on the iframe.. just like this..

    
    <div style="position:relative;">
    <iframe src="somepage.html" width="500" height="500" />
    <a href="redirect.html" style="position:absolute; top:0; left:0; display:inline-block; width:500px; height:500px; z-index:5;"></a>
    </div>
    
    HTML:
     
    JohnnySchultz, Nov 18, 2011 IP