Click to See Complete Forum and Search --> : Scrollbar missing in IE window
Duke Will
07-24-2003, 04:05 PM
At http://www.dukewill.com (my site I am working on), I have it configured to pop up a window when they leave the main page. To remind them of a couple of important points. If this is a blatant nono, advise. Anyway, I have it done up there near the top of the code... search for "justpop." In my Opera7, the window it creates is configured correctly. In my IE5, the new page has no scrollbar. Any ideas?
You can refresh or just click on a link and it will pop up the new page.
Duke Will
07-24-2003, 05:23 PM
I think i have it fixed... the scrollbar issue. I wonder if there is a way to make it popup once and once only... forever.
Yeah, if javascript is enabled -- which is the only time they will get the popup anyway. You just need to set a cookie when you display the popup, and then check if the cookie is set. If so, don't display the popup...
[edit - Something like this:
<script type="text/javascript">
cookies = document.cookie;
pos = cookies.indexOf("popup=");
if (pos == -1) {
date = new Date();
date.setMonth(date.getMonth()+12); //set it to expire in 1 year
document.cookie = "popup=yes; expires="+date.toGMTString();
window.open("yourpage.htm","popup","width=400,height=300");
}
</script>]
Duke Will
07-24-2003, 07:24 PM
How would I incorporate it into what I have already? I am no expert. I have...
<script language="JavaScript">
<!-- Begin
function justpop() {
window.open("notice.html","page","resizable=no,scrollbars=yes,height=460,width=600,alwaysRaised=yes,status=yes,top=40,left=115 screenY=40, screenX=115");
}
// -->
</script>
Originally posted by pyro
Yeah, if javascript is enabled -- which is the only time they will get the popup anyway. You just need to set a cookie when you display the popup, and then check if the cookie is set. If so, don't display the popup...
[edit - Something like this:
<script type="text/javascript">
cookies = document.cookie;
pos = cookies.indexOf("popup=");
if (pos == -1) {
date = new Date();
date.setMonth(date.getMonth()+12); //set it to expire in 1 year
document.cookie = "popup=yes; expires="+date.toGMTString();
window.open("yourpage.htm","popup","width=400,height=300");
}
</script>]
<script type="text/javascript">
function justpop() {
cookies = document.cookie;
pos = cookies.indexOf("popup=");
if (pos == -1) {
date = new Date();
date.setMonth(date.getMonth()+12); //set it to expire in 1 year
document.cookie = "popup=yes; expires="+date.toGMTString();
window.open("notice.html","page","resizable=no,scrollbars=yes,height=460,width=600,alwaysRaised=yes,status=yes,top=40,left=115 screenY=40, screenX=115");
}
}
</script>the window.open all goes on one line
Duke Will
07-24-2003, 11:15 PM
Thanks so much! When developing the site, I will need to see that it is working. What's best way for me to do that? Can it ignore me or would I have to do something with my cookies setting or what? (Again, I'm no expert.)
I'm assuming your asking how to reset the cookie? If so, change this line:
date.setMonth(date.getMonth()+12); //set it to expire in 1 year
to:
date.setMonth(date.getMonth()-1); //set it to expire in -1 month (any negative value will work...)