|
-
Sep 17th, 2002, 05:15 PM
#1
Thread Starter
Fanatic Member
vbworld's flying windows
how can i make a window that flies around like the one wbworld has. Also if possible i want that window to stay always on top of other windows
-
Sep 18th, 2002, 05:01 AM
#2
Addicted Member
The cool thing about client-side script, is that you can always have a look at it and copy paste it if you want.
Anyway this is the code that vbworld uses:
<script>
var popwindow
var popwindowwidth=200
var popwindowheight=150
var popwindowtop=200
var popwindowURL='promotion.aspx'
var waitingtime=4
var pause=20
var step=40
var popwindowleft=-popwindowwidth-50
var marginright
var pagecenter
var timer
waitingtime= waitingtime*1000
function showWindow() {
popwindow = window.open(popwindowURL, 'popwindow', 'toolbar=no,width='+popwindowwidth+',height='+popwindowheight+',top='+popwindowtop+',left='+(-popwindowwidth)+'');
if (document.all) {
marginright = screen.width+50
}
if (document.layers) {
marginright = screen.width+50
}
pagecenter=Math.floor(marginright/2)-Math.floor(popwindowwidth/2)
movewindow()
}
function movewindow() {
if (popwindowleft<=pagecenter) {
popwindow.moveTo(popwindowleft,popwindowtop)
popwindowleft+=step
timer= setTimeout('movewindow()',pause)
}
else {
clearTimeout(timer)
timer= setTimeout('movewindow2()',waitingtime)
}
}
function movewindow2() {
if (popwindowleft<=marginright) {
popwindow.moveTo(popwindowleft,popwindowtop)
popwindowleft+=step
timer= setTimeout('movewindow2()',pause)
}
else {
clearTimeout(timer)
popwindow.close()
}
}
</script>
-
Sep 18th, 2002, 09:43 AM
#3
Frenzied Member
To be honest, I find pop-ups (sliding or otherwise) annoying and will, if possible, avoid sites that employ them. It seems I will just have to put up with the one on this site.
-
Sep 18th, 2002, 10:53 AM
#4
Thread Starter
Fanatic Member
ccoder the client asked for it so i have to deliver
-
Sep 18th, 2002, 11:09 AM
#5
Frenzied Member
Originally posted by tina104291325
ccoder the client asked for it so i have to deliver
Well ... the customer is always right!
Sorry if it sounded like I was saying you shouldn't do it. I was just venting. I usually wrap a post like that with <rant></rant> tags to hopefully inject a little humor. I just forgot this time.
BTW, does anyone else get an error on line 59 - Access error when they try to close Karl's sliding window?
Last edited by ccoder; Sep 18th, 2002 at 11:13 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|