PDA

View Full Version : Loading ModalBox on Page Load


rikkublue
02-06-2008, 10:06 AM
Hi,

I'm trying to activate ModalBox (http://www.wildbit.com/labs/modalbox/) automatically on page load. No clicking involved or anything. Any ideas? I stuck the code into the body, but since I couldn't specify a page or a title it wouldn't work.

If it's also possible I'd like to prevent the ModalBox from automatically loading on page load more than just the first time if they revisit the page. If that's not possible then that's okay. Mostly just looking for the first thing though.

Any help would be greatly appreciated.

rangana
02-06-2008, 08:00 PM
Have you tried putting in the <body> tag the onLoad attribute??...Like
<body onLoad="Modalbox.show($('IDname'), {title: this.title, width: 300});">

Where IDname is the name of the block you want to be shown.

See if it helps.

rikkublue
02-07-2008, 08:28 AM
That seems to work! Unfortunately as best as I can tell it won't support the "title" attribute since it's not being activated in a link. Any ideas?

Is there a way to activate a link on page load? That would probably solve the problem.

rangana
02-07-2008, 06:57 PM
Hi rikkublue,
To activate a link on load, you could have this code:
<body onload="document.getElementById('link').focus()">
Where link is the name of your link as in <a name="link">
See if it helps. :D

rikkublue
02-08-2008, 08:37 AM
I tried that out and all it did was make the link on the page selected. As if I were tabbing through the links on the page. It didn't actually load the automatically on page load.

:(

¥åßßå
02-08-2008, 11:46 AM
<body onLoad="Modalbox.show($('IDname'), {title: your groovy title here, width: 300});">

¥

rikkublue
02-08-2008, 02:30 PM
I had actually tried that originally. Didn't work then and second attempt didn't work either. Just get an error message.

se_p800
04-20-2008, 03:38 PM
Hi I started a similar thread in regards to your second point: If it's also possible I'd like to prevent the ModalBox from automatically loading on page load more than just the first time if they revisit the page. I

Did you ever manage to find a solution for that? Or does anybody know what I can do?

3388
05-07-2008, 07:39 AM
just come to have a look