/    Sign up×
Community /Pin to ProfileBookmark

Apologies I know its been asked before

[FONT=Verdana][COLOR=Sienna]Hi All
New User posting. I have a problem which everyone must have come across but I’ve used search and can’t find an answer.
I creating a new site of bits and pieces -slideshows, photos etc and had hoped to include some simplke scriptsthat appeal to my sense of humour.

I have used a dhtml menu and it functions across all browsers, however when I add a javascript function onto the page it will not work in Gecko browsers (netscape Mozilla etc).
I’m sure when I played with applets I came across this problem then, am I right in assumiong you can’t run two javascripts on the same page in Gecko browsers.

An example is at [url]http://www.ijm.me.uk/test.html[/url], its fine in Avant IE etc.
The menu doesn’t work the pages aren’t there yet, no point until I get it to work cross browser.

TIA
Regards
Paul[/COLOR][/FONT]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@kitofersApr 20.2005 — Yes, you can only run 1.79 scripts or 301 lines of code (whichever comes first) on one page in Gecko browsers.

No, silly, of course you can run as many scripts as you wish. There must be a problem in the "second" script you are trying to run. What is it - can we see it? If it's already in the source, which one is it? I'm too lazy to find out for myself. ?
Copy linkTweet thisAlerts:
@ijmauthorApr 20.2005 — [COLOR=Magenta]Yes, you can only run 1.79 scripts or 301 lines of code (whichever comes first) on one page in Gecko browsers.



No, silly, of course you can run as many scripts as you wish. There must be a problem in the "second" script you are trying to run. What is it - can we see it? If it's already in the source, which one is it? I'm too lazy to find out for myself. ?
[/QUOTE]
[/COLOR]

In the <head> section

[COLOR=Sienna]<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>

<style type="text/css">

v:* { behavior: url(#default#VML); }

</style>[/COLOR]


in the body

[COLOR=Sienna]<script type="text/javascript">



/***********************************************

*
3D Spinning Message Script- By Copyright (c) 2003 Peter Gehrig

* Website: http://www.24fun.com

*
Script available at/modified by Dynamic Drive (http://www.dynamicdrive.com)

* This notice must stay intact for use

*
**
********************************************/





// Add as many messages as you like

var message=new Array("ijm web design 2005", "script stolen from", "Dynamic Drive.com", "Don't forget to visit", "uk.people.silversurfers", "the best group on the net", "that's all folks")



// Set the outline-color. Add as many colors as you like

var outlinecolor=new Array("black", "blue", "white", "navy", "orange")



// Set fillcolors 1. Add as many colors as you like

var fillcolor1=new Array("purple", "teal", "blue", "aqua", "gray")



// Set fillcolors 2. Add as many colors as you like

var fillcolor2=new Array("blue", "red", "yellow", "lime", "silver")



// Set the letter marking the circle

var circlemark=new Array("-")



// Set the width of the outline

var strkweight=4



// Set the waiting time between the messages (seconds)

var pause=2



// Set the strength of the opacity (transparency of letters)

var strengthopacity="60%"



// Set the size of the circle (values range from 0.1 to 1)

var circlesize=0.5



// Always keep messages in view even if page is scrolled? (DD added option)

var keepinview="yes"



// Do not edit below this line



mytruebody=(!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body //Dynamicdrive added object



var outerwidth=mytruebody.clientWidth

var outerheight=mytruebody.clientHeight



var innerwidth=Math.floor(circlesize*outerwidth)

var innerheight=Math.floor(circlesize*
outerheight)



var posleft=(outerwidth-innerwidth)/2

var postop=(outerheight-innerheight)/2



var path=new Array()

var i_message=0

var i_outlinecolor=0

var i_fillcolor1=0

var i_fillcolor2=0

var i_messagelength=0

var longestmessage=0

pause*=1000



var ie=document.getElementById&&document.all?1:0



for (i=0;i<=message.length-1;i++) {

if (message[i].length>longestmessage) {

longestmessage=message[i].length

}

longestmessage+=4

}



for (i=0;i<=message.length-1;i++) {



var emptyspace=""
var i_emptyspace=(longestmessage-message[i].length)/2
for (ii=0;ii<=i_emptyspace;ii++) {
emptyspace+=circlemark
}
message[i]=emptyspace+" "+message[i]+" "+emptyspace

}

function changeform() {

if (keepinview=="yes") //DD added

document.getElementById("roofid").style.top=mytruebody.scrollTop //DD added

if (i_outlinecolor >= outlinecolor.length) {i_outlinecolor=0}

if (i_fillcolor1 >= fillcolor1.length) {i_fillcolor1=0}

if (i_fillcolor2 >= fillcolor2.length) {i_fillcolor2=0}

document.getElementById('strokeid').color=outlinecolor[i_outlinecolor]

document.getElementById('fillid').color=fillcolor1[i_fillcolor1]

document.getElementById('fillid').color2=fillcolor2[i_fillcolor2]

if (i_message < message.length) {tick()}

else {document.getElementById('textpathid').string=""

document.getElementById("roofid").style.display="none" //DD added

}

}

function tick() {

if (i_messagelength <= message[i_message].length) {

var messagestringend=""

var messagestring=message[i_message].substring(0, i_messagelength)+messagestringend

document.getElementById('textpathid').string=messagestring

var timer=setTimeout("tick()",50)

i_messagelength++

}

else {

clearTimeout(timer)

i_messagelength=0

i_message++

i_outlinecolor++

i_fillcolor1++

i_fillcolor2++

var timer=setTimeout("changeform()",pause)

}

}

if (ie) {

document.write('<div id="roofid" style="position:absolute;left:0px;top:0px;width:'+outerwidth+'px;height:'+outerheight+'px;overflow:hidden;">')

document.write('<v:oval id="tc" style="position:absolute;top:'+postop+'px;left:'+posleft+'px;width:'+innerwidth+'px;height:'+innerheight+'px">')

document.write('<v:shadow on="t" opacity="'+strengthopacity+'"/>')

document.write('<v:stroke id="strokeid" weight="'+strkweight+'pt" color="blue"/>')

document.write('<v:fill id="fillid" on="True" color="'+fillcolor1[0]+'" color2="'+fillcolor2[0]+'" opacity="'+strengthopacity+'" opacity2="'+strengthopacity+'" type="gradient"/>')

document.write('<v:path textpathok="t"/>')

document.write('<v:textpath id="textpathid" on="t" id="mytp" style="font-family:'Arial Black'; " fitpath="t" string=""/>')

document.write('</v:oval></div>')

if (window.attachEvent) //DD added code

window.attachEvent("onload", changeform) //DD added code

else

window.onload=changeform

}

</script>[/COLOR]

Regards

Paul
Copy linkTweet thisAlerts:
@ijmauthorApr 20.2005 — [COLOR=Magenta][/COLOR]

In the <head> section

[COLOR=Sienna]<xml:namespace ns="urn:schemas-microsoft-com:vml" prefix="v"/>

<style type="text/css">

v:* { behavior: url(#default#VML); }

</style>[/COLOR]



<Puts brain back in gear> Its VML and Geckos don't support it ? . Apologies all round.
×

Success!

Help @ijm 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...