Iframe 30 sec refresh keeps stealing focus. How to stop?
Posted 03 April 2006 - 06:47 PM
I did some searching and found this page: [a href=\"http://www.w3schools.com/htmldom/dom_obj_iframe.asp\" target=\"_blank\"]http://www.w3schools.com/htmldom/dom_obj_iframe.asp[/a]
blur() Removes focus from the iframe
focus() Gives focus to the iframe
Can somebody tell me how I use this (if this is what is going to work best) with my iframes so they don't steal the focus of the entire page?
I would appreciate any help you can provide since I've had to turn the refresh down from 30 secs to 5 minutes and will likely mean I'm losing money I could have otherwise made.
Thanks in advance for any help or direction you can give me.
Posted 07 April 2006 - 02:52 PM
What's worse, I'm not sure you can change focus between frames. You could try this:
Posted 07 April 2006 - 08:22 PM
Posted 07 April 2006 - 11:02 PM
<embed id="ID" ... >...but that's an aside.
As for how to update the banner, there are a few options. You could do something like this:
<div id="ads"> <a href="www.somesite.com"><img src="ad.jpg" /></a> </div>...where your ad is put inside a DIV, then use the DOM property of innerHTML to change the DIV as needed. As so:
document.getElementByID('ads').innerHTML="<a href=\"www.newsite.com\"><img src=\"newad.jpg\"></a>";Or, you could assign a unique ID to the anchor tag and the image tag, and update them using the href and src properties, respectively:
document.getElementByID('link').href="http://www.asite.com/"; document.getElementByID('banner').src="theadbanner.gif";You would need to use the setTimeout function to cause the information to update either way, but it isn't a very complicated thing to do. It's commonly used for clocks and whatnot.
Posted 09 April 2006 - 12:51 AM
Posted 09 April 2006 - 01:15 AM
That looks like it might work, but I don't know much about coding other than following peoples instructions. My ad code is provided by an ad company so it's already in a script tag not site url and ad image. Can you help me with what exactly I need to put into the page code to get it to refresh every 30 seconds?
// Produce two new arrays to hold the information. var banners = new Array(); var links = new Array(); // The banners array holds the URLs of 4 banners. banners = "banner1.jpg"; banners = "banner2.jpg"; banners = "banner3.jpg"; banners = "banner4.jpg"; // The links array holds the matching links for the banners array. links = "http://www.asite.com/"; links = "http://www.anothersite.com/"; links = "http://www.notasite.com/"; links = "http://www.asdfghjkl.com/";You would then need to have myfunction() look something like this:
Posted 12 April 2006 - 03:54 AM
If nothing else, couldn't something peppered with AJAX work? (from what I know about how it can dynamically change things on a page without reloading the whole page, this seems like it would be small compared to what AJAX is capable of.)
Can you give me more help? I would relaly appreciate it. I was making some good advertising money finally with my banner refreshing... but after I saw that it was interfering with content I had to remove it.
Thanks for any help anybody can provide me.
Posted 15 May 2006 - 07:54 PM
Posted 15 May 2006 - 08:27 PM
[!--html--][div class=\'htmltop\']HTML[/div][div class=\'htmlmain\'][!--html1--]<iframe id="ad"></iframe>[!--html2--][/div][!--html3--]
or [php] * 1000... PLEASE READ THE POSTED SOLUTIONS CAREFULLY * 1000000...
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users