PDA

View Full Version : How can I display a banner 1~2 seconds earlier?


sammy0630
01-22-2003, 09:37 AM
Hi,

I've been trying to find a script that can display banners 1~2 seconds earlier than the rest of the Webpage. I know java script can do it but have no idea where to get it.
If you have one, please let me know or tell me where to get it.
Thanks.
Sammy

Mhtml
01-22-2003, 01:11 PM
Javascripts are executed as the browser processes the code. Therefore having a javascript before the rest of the body content will bring up the popup quicker.

But if you really wished to display it quicker than the rest of the content regardless of how fast a users connection and computer are (these make a diff. because the faster it is downloaded and processed the less delay) you should just have a page that redirects to the page you are going to display.

So something like this would work fine..


var TimeOut = setTimeout("loadPage()", 2000)
function loadPage() {
location = 'http://www.here.com/theNextPage.html'
}


Obviously the script for the ads will be before that script which will wait 2 seconds before redirecting.

whammy
01-23-2003, 01:36 AM
If I saw only a banner while loading a website (and I was paying attention), and then had to wait 2+ seconds before the page loaded, I might considerably close the browser window thinking the site was pure spam. Either that, or I would think the website was fairly slow (since I use cable).

Just a thought. :)

sammy0630
01-23-2003, 04:24 AM
Originally posted by sammy0630
Hi,

I've been trying to find a script that can display banners 1~2 seconds earlier than the rest of the Webpage. I know java script can do it but have no idea where to get it.
If you have one, please let me know or tell me where to get it.
Thanks.
Sammy

Guys,

I'm not a spamwebsiter or anything.
I'm a doctoral student working on an experiment. What I'm trying to do is to load the banner "earlier" than all other elements. I used Namo webeditor several years ago and this editor used to have this script that could load a graphic file (such as banner) ealier than other elements. Unfortunately, the new Namo editor that I'm using does not come with that function, which is a pity.
Anyway, it does not necessarily have to be 1~2 seconds but I need to make sure that the banner is loaded first.
Thanks a bunch.
Sammy

Spookster
01-23-2003, 06:25 AM
One possible way would be to use layers with graphics.

Create a small 1x1 pixel gif the same color as the background of the page.

Put it inside an absolutely positioned layer and set the width and height of the image to be the size of the browers viewable area. Set the z-index of that layer to be something like 2. Set the visibility to visible. Create a function using a timer to change the visibility of that layer after however many seconds you want.

Create a second absolutely positioned layer. Put the banner ad inside it. Set its visiblility to visible. Set its z-index to something like 1.

Essentially what goes on here is hiding the rest of the content in the page while the banner ad displays above everthing. Once you hide the other layer everthing becomes visible.