|
|
Sergio |
|
|
Posts: 60
Gender:  Male
Posts Per Day: 0.04
Time Online: 23 hours 19 minutes
Location: Palermo Italy
|
I have inserted in the home page of the forum ( http://www.forum-restauro.org/forum /) an unstoppable html popup windows (Once per browser session).
|
Code
<head>
<script language="JavaScript1.2">
var ie=document.all
var dom=document.getElementById
var ns4=document.layers
var calunits=document.layers? "" : "px"
var bouncelimit=32 //(must be divisible by 8)
var direction="up"
function initbox(){
if (!dom&&!ie&&!ns4)
return
crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
crossobj.top=scroll_top-250+calunits
crossobj.visibility=(dom||ie)? "visible" : "show"
dropstart=setInterval("dropin()",50)
}
function dropin(){
scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
if (parseInt(crossobj.top)<100+scroll_top)
crossobj.top=parseInt(crossobj.top)+40+calunits
else{
clearInterval(dropstart)
bouncestart=setInterval("bouncein()",50)
}
}
function bouncein(){
crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
if (bouncelimit<0)
bouncelimit+=8
bouncelimit=bouncelimit*-1
if (bouncelimit==0){
clearInterval(bouncestart)
}
}
function dismissbox(){
if (window.bouncestart) clearInterval(bouncestart)
crossobj.visibility="hidden"
}
function truebody(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function get_cookie(Name) {
var search = Name + "="
var returnvalue = ""
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}
function dropornot(){
if (get_cookie("droppedin")==""){
window.onload=initbox
document.cookie="droppedin=yes"
}
}
dropornot()
</script>
</head>
|
|
|
Code
<body>
<div id="dropin" style="position:absolute;visibility:hidden;left:100px;top:100px;width:500px;height:300px;background-color:#F5F5F5">
<div align="right"><a href="#" onClick="dismissbox();return false">[Close Box] </a></div>
<!-- start your html here -->
<h2>Add the html for you ad here!</h2>
<!-- end your html here -->
</div>
</div>
|
|
This popup doesn't load him. In other page ( http://www.forum-restauro.org/ ) is regularly visualized. Because? |
| Sergio Tinè |
|
|
|
|
|
Justin |
|
|
Posts: 15,075
Gender:  Male
Posts Per Day: 6.52
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 27 minutes
Location: Tallassee, AL
Age: 22
|
|
|
|
|
|
Sergio |
|
|
Posts: 60
Gender:  Male
Posts Per Day: 0.04
Time Online: 23 hours 19 minutes
Location: Palermo Italy
|
Justin, sorry, I had cancelled the script from the template.htm because he didn't load. I have now inserted again him and you can see that he doesn't load |
| Sergio Tinè |
|
|
|
|
|
Justin |
|
|
Posts: 15,075
Gender:  Male
Posts Per Day: 6.52
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 27 minutes
Location: Tallassee, AL
Age: 22
|
|
|
|
|
|
Sergio |
|
|
Posts: 60
Gender:  Male
Posts Per Day: 0.04
Time Online: 23 hours 19 minutes
Location: Palermo Italy
|
Ok !! The announcement now appears.  A conflict among the scripts? |
| Sergio Tinè |
|
|
|
|
|
Justin |
|
|
Posts: 15,075
Gender:  Male
Posts Per Day: 6.52
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 27 minutes
Location: Tallassee, AL
Age: 22
|
|
|
|
|
|
Martin |
|
|
Posts: 4,558
Gender:  Male
Posts Per Day: 3.14
Reputation: 98.60%
Reputation Score: +211 / -3
Time Online: 35 days 19 hours 25 minutes
Location: UK
Age: 50
|
It's the window.onload call in the script, it conflicts with the same call in BoardIndex.pl when you have the news enabled. window.onload = start; is in BoardIndex.pl, you can't have 2 events like this they would have to be combined. Script 1
|
Code
<script language="javascript">
function start(){
...code for script #1...
}
window.onload=start;
</script> |
|
Script 2
|
Code
<script language="javascript">
function initbox(){
...code for script #2...
}
window.onload=initbox;
</script> |
|
Would become
|
Code
<script language="javascript">
function start(){
...code for script #1...
}
function initbox(){
...code for script #2...
}
window.onload=function(){
start();
initbox();
}
</script> |
|
Hope I have explained this OK |
| Martin's Reputation: Increase |
|
|
|
|
|
iCONICA |
|
|
Posts: 761
Gender:  Male
Posts Per Day: 2.39
Reputation: 97.14%
Reputation Score: +34 / -1
Time Online: 11 days 3 hours 11 minutes
Location: Manchester UK
|
|
|
|
|
|
Ratztails |
|
|
Posts: 63
Gender:  Female
Posts Per Day: 0.35
Reputation: 100.00%
Reputation Score: +4 / -0
Time Online: 17 hours 53 minutes
|
WOW perfect martin, great explanation! Thanks.
I agree!  |
|
|
|
|
|
|