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 so that it opens in a new window as a new page? Any ideas?
<a href=\"example.com/banner.jpg\" target="_blank"><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></a> I guess that will do the job
hello, You;re absolutely correct that <a> tag will not wok. This should use an event called "onClick" so, if you want to redirect the user on back page while clicking on that iframe, then the code should looks like: <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\" onClick=\"javascript:window.history(-1);\"></iframe>