PDA

View Full Version : Open delay for stayontop.js script



mediatrend
06-20-2011, 07:01 PM
1) Script Title: stayontop.js

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/stayontop.htm

3) Describe problem: I'd like to delay open of layer, maybe possibile to indicate into the parameters a value where I can specify time form the load of the page and the show of the layer ?

Thanks in advance to all for support.
Marco.

ddadmin
06-20-2011, 07:58 PM
Sure, try the below modified .js file, which adds a "showafter" option, in milliseconds. Then in your initialization code, you can specify a delay before the content is shown on the page:


alwaysOnTop.init({
targetid: 'examplediv',
orientation: 3,
position: [5, 10],
fadeduration: [1000, 1000],
frequency: 0.95,
hideafter: 15000,
showafter: 5000
})

Make sure inside the markup for the content in question that it's initially hidden, by setting its display property to "none":


<div id="examplediv" style="width:140px; border:1px solid gray; padding: 10px; background: lightyellow;display:none">

This DIV is static and shown 95% of the time the page loads. It's positioned relative to the lower left corner of the window. It disappears after 15 seconds.

</div>

mediatrend
06-21-2011, 10:55 AM
Thanks very much, this is exactly what I wanted :-)
Ciao,
Marco.

idlebg
03-18-2015, 03:24 PM
Hello there
where can i find the modified .js file ?

the attachment link
http://www.dynamicdrive.com/forums/misc.php?do=showattachments&t=62975
returns
vBulletin Message
There are no attachments to display