/    Sign up×
Community /Pin to ProfileBookmark

popup box works on one page but not on another

Hi there. I have a pop up box which should display on the index page of [url]www.ufreak.net[/url] but for some reason It will not display. The code is exactly the same on this page as it is on [url]www.ufreak.net/gallery.php[/url] (which displays the pop up) apart from the index page having the second bit of script for a scroller. Can anyone advise on what is going wrong here?

[CODE]<SCRIPT LANGUAGE=”JavaScript”>
<!– Pop up script –>

<!– Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval(“page” + id + ” = window.open(URL, ‘” + id + “‘, ‘toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=380,left = 490,top = 437’);”);
}
// End –>
</script>

</head>
<body onLoad=”javascript:popUp(‘popup.php’)”>[/CODE]

[CODE] <script language=”JavaScript1.2″>

/*
Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100’s more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee’s width (in pixels)
var marqueewidth=”245px”
//Specify the marquee’s height
var marqueeheight=”50px”
//Specify the marquee’s marquee speed (larger is faster 1-10)
var marqueespeed=2
//configure background color:
var marqueebgcolor=”transparent”
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee’s content (don’t delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that’s great):

var marqueecontent='<nobr><p>OCTOBER UFREAK LINE UP… COMING SOON… CHECK THIS SPACE… HQ</p></nobr>’

////NO NEED TO EDIT BELOW THIS LINE////////////
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write(‘<span id=”temp” style=”visibility:hidden;position:absolute;top:-100px;left:-9000px”>’+marqueecontent+'</span>’)
var actualwidth=”
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById(“iemarquee”) : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+”px”
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById(“temp”).offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval(“scrollmarquee()”,20)
}
window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+”px”
else
cross_marquee.style.left=parseInt(marqueewidth)+8+”px”

}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write(‘<table border=”0″ cellspacing=”0″ cellpadding=”0″><td>’)
if (iedom){
write(‘<div style=”position:relative;width:’+marqueewidth+’;height:’+marqueeheight+’;overflow:hidden”>’)
write(‘<div style=”position:absolute;width:’+marqueewidth+’;height:’+marqueeheight+’;background-color:’+marqueebgcolor+'” onMouseover=”copyspeed=pausespeed” onMouseout=”copyspeed=marqueespeed”>’)
write(‘<div id=”iemarquee” style=”position:absolute;left:0px;top:0px”></div>’)
write(‘</div></div>’)
}
else if (document.layers){
write(‘<ilayer width=’+marqueewidth+’ height=’+marqueeheight+’ name=”ns_marquee” bgColor=’+marqueebgcolor+’>’)
write(‘<layer name=”ns_marquee2″ left=0 top=0 onMouseover=”copyspeed=pausespeed” onMouseout=”copyspeed=marqueespeed”></layer>’)
write(‘</ilayer>’)
}
document.write(‘</td></table>’)
}
}
</script>[/CODE]

to post a comment
JavaScript

24 Comments(s)

Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — *bump*

Hate to do this because it makes you look pushy. Just don't want it dissappearing off the 1st page.
Copy linkTweet thisAlerts:
@JMRKERSep 07.2006 — Do I make the correct assumption that:

1. Your popup php is on the same directory as you are calling it from?

2. Your permissions to display the pop-up remain the same in both calling scripts?

3. You get no errors in the javascript: console display using FF browser or an error in IE error display?

Can you make the popup an external '.js' file that can be called from either site?


That way, you only need to correct in one script if you find errors.
Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — 1. Your popup php is on the same directory as you are calling it from?

2. Your permissions to display the pop-up remain the same in both calling scripts?

3. You get no errors in the javascript: console display using FF browser or an error in IE error display?[/QUOTE]

Hi JMRKER.

1. Yes, index.php, gallery.php and popup.php are all in the same directory.

2. They all have 644 permissions.

3. I only have IE at work right now and I'm not really sure what IE error display is. If you could advise on that,that'd be great!

The popup isn't actually a js itself. I just use Javascript to make a php form appear in order for users to sign up to a news letter.

Hope this crears up any uncertainties.

Graham
Copy linkTweet thisAlerts:
@JMRKERSep 07.2006 — Yes, that helps. I do not have php access on my site so I guess you would not get a javascript error in IE when calling a php form.

The js error in IE appears as a 'yellow !' symbol on the lower part of your screen in the status bar of your browser. I'm also sssuming you have js error checking turned on in your IE browser.
Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — If that's just the "display notification on script errors" under advanced in internet options then it is on. I'm not getting any errors coming up> Just says "done". I copied the source code into an html file called tester.html and it still didn't work so php doesn't look guilty.
Copy linkTweet thisAlerts:
@JMRKERSep 07.2006 — Well I guess you require an answer that is above my pay grade.

Sorry, I don't know enough about php to answer your question.

If you still think it is a javascript problem, try adding some alert boxes

scattered in your code to assure that it is making it that far in both site scripts.

When it makes it to a particular alert in one and doesn't in the other,

then you can isolate the offending code.

Just a suggestion. Hope it helps.
Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — Hey don't worry about it. That's an excelent Idea. First I need to read up on how to make alert boxes (rudimentary stuff I know but my JS knowledge is cr@p at best.

Thanks

Graham
Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — I tried <body onLoad="javascript:alret('testing')"> rather than the popUp function and nothing happened. Isn't that strange?
Copy linkTweet thisAlerts:
@JMRKERSep 07.2006 — Hopefully you spelt 'alert' better than 'alret' in your code (?)
Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — HAHAH!!! Yes I did. I copied and pasted from a tutorial and all was present and corretc. Bu thanks anyway ?
Copy linkTweet thisAlerts:
@JMRKERSep 07.2006 — Did the alert message show up in one call to the php code and not the other?

Or did it not show up in either?

Still no error message?

Still trying (very trying) to help!
Copy linkTweet thisAlerts:
@DoppleauthorSep 07.2006 — Didn't work in either of the php files or the html test file! Bah!
Copy linkTweet thisAlerts:
@JMRKERSep 07.2006 — OK, I wrote this little test script because your problem is bugging me.

On my system (using FF), the onLoad alert does not show up as an alert message

but the button alert does. This may explain why you are not getting anything visible when you put the alert into the onLoad.

I don't know, but I think the reason is that the page must be fully loaded BEFORE the alert function can be activated, but this is just a guess.

When I tested it on IE, and it did the same thing.

[code=php]
<html>
<head>
<title>Alert Test</title>
<script type="text/javascript">
function LoadAlert() {
alert('This message does not show up when page is loaded');
}
</script>
</head>
<body onLoad="LoadAlert()">
<h1>Alert Test</h1>
<button onClick="javascript:alert('Test of alert in javascript')">Click to alert</button>
</body>
</html>
[/code]

See if the above does the same on your system, then try scattering the alert messages within the different (but similiar) codes that are giving you fits and see where the error lies. (Leave out the onLoad function)

Like Winston Churchill said: "Never, Never, Never give up". ?
Copy linkTweet thisAlerts:
@DoppleauthorSep 08.2006 — The onLoad did work for me on the test script but I'm using IE (I'm back at work so don't have access to Firefox). Is there another way to make a pop up automatically display without using onLoad in the body tag?
Copy linkTweet thisAlerts:
@DoppleauthorSep 08.2006 — Does the code that folows HAVE to go between the head tags?Could it maybe go lower down in the file? I'm sure it must be something to do with one of the other javascripts on the page.
[CODE]<SCRIPT LANGUAGE="JavaScript">
<!-- Pop up script -->


<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=380,left = 490,top = 437');");
}
// End -->
</script>

</head>
<body onLoad="javascript:popUp('popup.php')">[/CODE]
Copy linkTweet thisAlerts:
@JMRKERSep 09.2006 — Is there another way to make a pop up automatically display without using onLoad in the body tag?[/QUOTE]

There is something called an "event timer" but I have not used this method. You can try the 'search' function of this forum or google some combination of keywords that may give some insite.

Otherwise there is nothing else that I am aware of, but perhaps others more knowledgable than me can offer a suggestion of alternate methods (if there are any).
Copy linkTweet thisAlerts:
@DoppleauthorSep 09.2006 — Well thanks for your help so far! I'll check out the event timer. Cheers for the tip!
Copy linkTweet thisAlerts:
@m_burtSep 09.2006 — You can also use event handlers purely with JS:

<i>
</i>&lt;script type="textjavascript"&gt;
window.onload = function() {
alert("blah blah")
}
&lt;/script&gt;


But you can't use document.body event handlers by themselves ?
Copy linkTweet thisAlerts:
@konithomimoSep 10.2006 — You cannot have more than one onload call on a page. To make both events happen onload simply add them both to the same onload call.
Copy linkTweet thisAlerts:
@DoppleauthorSep 10.2006 — You cannot have more than one onload call on a page. To make both events happen onload simply add them both to the same onload call.[/QUOTE]
Aha! That is probably the issue. The only problem is with my total noviceness of javascript I wouldn't know where to start editing what I have.

My page code is below. and the page is www.ufreak.net. I searched for onload and found 3 instances. Can anyone advise what the best way to sort that out would be?

[edit] text was too long so I had tp cut out most of the html leaving the javasctipt. Basically everything below the body tag is in the head. I've left the body tag in for reference of the onload code.

[code=html]

<script language="JavaScript">
<!-- Pop up script -->


<!-- Begin
function popUp(URL) {
day = new Date();

id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=380,left = 490,top = 437');");
}
// End -->
</script>


<!--[if lt IE 7]>
<script language="JavaScript">
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version >= 5.5) && (document.body.filters))
{
for(var i=0; i<document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "<span " + imgID + imgClass + imgTitle
+ " style="" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src='" + img.src + "', sizingMethod='scale');"></span>"
img.outerHTML = strNewHTML
i = i-1
}
}
}

}
window.attachEvent("onload", correctPNG);
</script>
<![endif]-->

<SCRIPT LANGUAGE="JavaScript">
<!-- Pop up script -->


<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=380,left = 490,top = 437');");
}
// End -->
</script>


</head>




<body onLoad="javascript:popUp('popup.php')">




<script type="text/javascript">
<!-- Begin

var winW = 0, winH = 0;

if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth-16;
winH = window.innerHeight-16;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
if (winW = 1600) {
document.write('<div id="leftbar"><img src="new/img/leftside1000px.png" /></div><div id="rightbar"><img src="new/img/rightside1000px.png" /></div>');
}
else if (winW = 1280) {
document.write('<div id="leftbar"><img src="new/img/leftside1000px.png" /></div><div id="rightbar"><img src="new/img/rightside1000px.png" /></div>');
}
else if (winW = 1024) {
document.write('<div id="leftbar"><img src="new/img/leftside.png" /></div><div id="rightbar"><img src="new/img/rightside.png" /></div>');
}
else if (winW = 800) {
document.write('<div id="leftbar"><img src="new/img/leftside.png" /></div><div id="rightbar"><img src="new/img/rightside.png" /></div>');
}
else {
document.write('<div id="leftbar"><img src="new/img/leftside.png" /></div><div id="rightbar"><img src="new/img/rightside.png" /></div>');
}
// End -->
</script>




<script language="JavaScript1.2">

/*
Cross browser Marquee script- © Dynamic Drive (www.dynamicdrive.com)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit http://www.dynamicdrive.com
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="245px"
//Specify the marquee's height
var marqueeheight="50px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=4
//configure background color:
var marqueebgcolor="transparent"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content (don't delete <nobr> tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that's great):

var marqueecontent='<nobr><p>OCTOBER UFREAK LINE UP... COMING SOON... CHECK THIS SPACE... HQ</p></nobr>'


////NO NEED TO EDIT BELOW THIS LINE////////////
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
var actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}
window.onload=populate

function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left>(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
if (iedom){
write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
write('</div></div>')
}
else if (document.layers){
write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
write('</ilayer>')
}
document.write('</td></table>')
}
}
</script>

[/code]
Copy linkTweet thisAlerts:
@konithomimoSep 10.2006 — Simply remove the 2 window.onload calls and add the calls to the body onload call. Here is the resulting code:

&lt;script language="JavaScript"&gt;
&lt;!-- Pop up script --&gt;


&lt;!-- Begin
function popUp(URL) {
day = new Date();

id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=380,left = 490,top = 437');");
}
// End --&gt;
&lt;/script&gt;


<i> </i>&lt;!--[if lt IE 7]&gt;
&lt;script language="JavaScript"&gt;
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 &amp; 6.
{
var arVersion = navigator.appVersion.split("MSIE")
var version = parseFloat(arVersion[1])
if ((version &gt;= 5.5) &amp;&amp; (document.body.filters))
{
for(var i=0; i&lt;document.images.length; i++)
{
var img = document.images[i]
var imgName = img.src.toUpperCase()
if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
{
var imgID = (img.id) ? "id='" + img.id + "' " : ""
var imgClass = (img.className) ? "class='" + img.className + "' " : ""
var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
var imgStyle = "display:inline-block;" + img.style.cssText
if (img.align == "left") imgStyle = "float:left;" + imgStyle
if (img.align == "right") imgStyle = "float:right;" + imgStyle
if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
var strNewHTML = "&lt;span " + imgID + imgClass + imgTitle
+ " style="" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
+ "(src='" + img.src + "', sizingMethod='scale');"&gt;&lt;/span&gt;"
img.outerHTML = strNewHTML
i = i-1
}
}
} <br/>
}
&lt;/script&gt;
&lt;![endif]--&gt;

&lt;SCRIPT LANGUAGE="JavaScript"&gt;
&lt;!-- Pop up script --&gt;


&lt;!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=350,height=380,left = 490,top = 437');");
}
// End --&gt;
&lt;/script&gt;


&lt;/head&gt;




&lt;body onload="popUp('popup.php'); correctPNG(); populate()"&gt;




&lt;script type="text/javascript"&gt;
&lt;!-- Begin

var winW = 0, winH = 0;

if (parseInt(navigator.appVersion)&gt;3) {
if (navigator.appName=="Netscape") {
winW = window.innerWidth-16;
winH = window.innerHeight-16;
}
if (navigator.appName.indexOf("Microsoft")!=-1) {
winW = document.body.offsetWidth;
winH = document.body.offsetHeight;
}
}
if (winW = 1600) {
document.write('&lt;div id="leftbar"&gt;&lt;img src="new/img/leftside1000px.png" /&gt;&lt;/div&gt;&lt;div id="rightbar"&gt;&lt;img src="new/img/rightside1000px.png" /&gt;&lt;/div&gt;');
}
else if (winW = 1280) {
document.write('&lt;div id="leftbar"&gt;&lt;img src="new/img/leftside1000px.png" /&gt;&lt;/div&gt;&lt;div id="rightbar"&gt;&lt;img src="new/img/rightside1000px.png" /&gt;&lt;/div&gt;');
}
else if (winW = 1024) {
document.write('&lt;div id="leftbar"&gt;&lt;img src="new/img/leftside.png" /&gt;&lt;/div&gt;&lt;div id="rightbar"&gt;&lt;img src="new/img/rightside.png" /&gt;&lt;/div&gt;');
}
else if (winW = 800) {
document.write('&lt;div id="leftbar"&gt;&lt;img src="new/img/leftside.png" /&gt;&lt;/div&gt;&lt;div id="rightbar"&gt;&lt;img src="new/img/rightside.png" /&gt;&lt;/div&gt;');
}
else {
document.write('&lt;div id="leftbar"&gt;&lt;img src="new/img/leftside.png" /&gt;&lt;/div&gt;&lt;div id="rightbar"&gt;&lt;img src="new/img/rightside.png" /&gt;&lt;/div&gt;');
}
// End --&gt;
&lt;/script&gt;




<i> </i> &lt;script language="JavaScript1.2"&gt;

/*
Cross browser Marquee script- © Dynamic Drive (<a href="www.dynamicdrive.com">www.dynamicdrive.com</a>)
For full source code, 100's more DHTML scripts, and Terms Of Use, visit <a href="http://www.dynamicdrive.com">http://www.dynamicdrive.com</a>
Credit MUST stay intact
*/

//Specify the marquee's width (in pixels)
var marqueewidth="245px"
//Specify the marquee's height
var marqueeheight="50px"
//Specify the marquee's marquee speed (larger is faster 1-10)
var marqueespeed=4
//configure background color:
var marqueebgcolor="transparent"
//Pause marquee onMousever (0=no. 1=yes)?
var pauseit=1

//Specify the marquee's content (don't delete &lt;nobr&gt; tag)
//Keep all content on ONE line, and backslash any single quotations (ie: that's great):

var marqueecontent='&lt;nobr&gt;&lt;p&gt;OCTOBER UFREAK LINE UP... COMING SOON... CHECK THIS SPACE... HQ&lt;/p&gt;&lt;/nobr&gt;'


////NO NEED TO EDIT BELOW THIS LINE////////////
marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var iedom=document.all||document.getElementById
if (iedom)
document.write('&lt;span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px"&gt;'+marqueecontent+'&lt;/span&gt;')
var actualwidth=''
var cross_marquee, ns_marquee

function populate(){
if (iedom){
cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
cross_marquee.innerHTML=marqueecontent
actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
}
else if (document.layers){
ns_marquee=document.ns_marquee.document.ns_marquee2
ns_marquee.left=parseInt(marqueewidth)+8
ns_marquee.document.write(marqueecontent)
ns_marquee.document.close()
actualwidth=ns_marquee.document.width
}
lefttime=setInterval("scrollmarquee()",20)
}


function scrollmarquee(){
if (iedom){
if (parseInt(cross_marquee.style.left)&gt;(actualwidth*(-1)+8))
cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
else
cross_marquee.style.left=parseInt(marqueewidth)+8+"px"

}
else if (document.layers){
if (ns_marquee.left&gt;(actualwidth*(-1)+8))
ns_marquee.left-=copyspeed
else
ns_marquee.left=parseInt(marqueewidth)+8
}
}

if (iedom||document.layers){
with (document){
document.write('&lt;table border="0" cellspacing="0" cellpadding="0"&gt;&lt;td&gt;')
if (iedom){
write('&lt;div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden"&gt;')
write('&lt;div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"&gt;')
write('&lt;div id="iemarquee" style="position:absolute;left:0px;top:0px"&gt;&lt;/div&gt;')
write('&lt;/div&gt;&lt;/div&gt;')
}
else if (document.layers){
write('&lt;ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'&gt;')
write('&lt;layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"&gt;&lt;/layer&gt;')
write('&lt;/ilayer&gt;')
}
document.write('&lt;/td&gt;&lt;/table&gt;')
}
}
&lt;/script&gt;
Copy linkTweet thisAlerts:
@DoppleauthorSep 10.2006 — Ok we're getting somewhere. I used the code which you advised but although the pop up works when using it the scroller stops working. At least we're getting close and we know the reason behind it. Any ideas to get both scripts working in harmony?
Copy linkTweet thisAlerts:
@DoppleauthorSep 10.2006 — Sorted. Strange. It only required this..,

<body onload="popUp('popup.php'); correctPNG(); populate()">

Changed to this...

<body onload="popUp('popup.php'); populate(); correctPNG()">

Anyway. thanks for everyones help!

Graham ? <- me right now!
Copy linkTweet thisAlerts:
@konithomimoSep 10.2006 — It could simply be the order that they are called in.

Edit - didnt see your last post . . .
×

Success!

Help @Dopple spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...