1) Amazon style drop in box
2) http://www.dynamicdrive.com/dynamici...amazondrop.htm
3) Describe problem:
I've been trying to add a time delay to this.......can anyone help please?
many thanks
1) Amazon style drop in box
2) http://www.dynamicdrive.com/dynamici...amazondrop.htm
3) Describe problem:
I've been trying to add a time delay to this.......can anyone help please?
many thanks
Add this (highlighted) configuration item:
Then in the function initboxv2, add the highlighted lines:Code:/*********************************************** * Amazon style Drop-in content box- © Dynamic Drive DHTML code library (www.dynamicdrive.com) * Visit DynamicDrive.com for hundreds of DHTML scripts * This notice must stay intact for legal use * Go to http://www.dynamicdrive.com/ for full source code ***********************************************/ var dropboxleft=200 //set left position of box (in px) var dropboxtop=100 //set top position of box (in px) var dropspeed=15 //set speed of drop animation (larger=faster)var dropdelay=1000 //set period of delay before drop (milliseconds, use 0 for no delay)//Specify display mode. 3 possible values are: //1) "always"- This makes the fade-in box load each time the page is displayed //2) "oncepersession"- This uses cookies to display the fade-in box only once per browser session //3) integer (ie: 5)- Finally, you can specify an integer to display the box randomly via a frequency of 1/integer... // For example, 2 would display the box about (1/2) 50% of the time the page loads. var displaymode="always" ///Don't edit beyond here///////////
Code:function initboxv2(){ if (!dom&&!ie) returnif (dropdelay){ setTimeout(initboxv2, dropdelay); dropdelay = 0; return; }crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover crossbox=(dom)?docume . . .
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
thanks for the fast response.
I've implemented as follows......but its doesn't work now. Any suggestions. Again thanks.
function initboxv2(){
if (!dom&&!ie)
return
if (dropdelay){
setTimeout(initboxv2, dropdelay);
dropdelay = 0;
return;
}
crossboxcover=(dom)?document.getElementById("dropinboxv2cover") : document.all.dropinboxv2cover
crossbox=(dom)?document.getElementById("dropinboxv2"): document.all.dropinboxv2
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossbox.height=crossbox.offsetHeight
crossboxcover.style.height=parseInt(crossbox.height)+"px"
crossbox.style.top=crossbox.height*(-1)+"px"
crossboxcover.style.left=dropboxleft+"px"
crossboxcover.style.top=dropboxtop+"px"
crossboxcover.style.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropinv2()",50)
}
That's only the second half of my code changes. Did you institute the first section? Without both parts, that second part will only cause an error. If you have instituted both parts faithfully, then there is either some problem with my idea, or a typo/error on one or the other or both our parts. Whatever the case:
Please post a link to the page on your site that contains the problematic code so we can check it out.
I know the concept is sound. We just need to get it working for you.
Edit: Added later:
I just tested my own advice. Works fine here.
If you do follow everything I outlined, you may want to try:
for the first part. That would be a 5 second delay, so much more noticeable than the 1000 millisecond (1 second) delay my original code provides.Code:var dropdelay=5000//set period of delay before drop (milliseconds, use 0 for no delay)
Last edited by jscheuer1; 08-17-2008 at 10:50 PM. Reason: add info
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
My apologies, I was being a dumbass.
I had set it to once per session.....and had not initiated a new session to test.
Appreciated.
Bookmarks