/    Sign up×
Community /Pin to ProfileBookmark

2 javascript apps on one page issues

Hi
Im having a probelem running two javascripts on my blogger webpage, when i use one it works fine but when i try to add the second it wont work.
the code is for a menu which comes floating across the screen when a button is clicked, u can view it here
[url]www.megtoonz.com[/url]

Below is the code
Please any help appreciated

<!doctype 1.0 strict//en -//w3c//dtd [url]http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd[/url] public html xhtml>

<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

<!– Original: David Sosnowski ([email protected]) –>
<!– Web Site: [url]http://www.codelifter.com[/url] –>

<!–
Put the <style> script in the <head> of your page.
Set up the border, background-color, padding, and
font elements as needed. Leave the position as is.
Width and height can be set as auto, or you can
specify these in pixels.
//–>

<style>

#menuShow{
border: 1px solid #ffffff;
background-color: #ffffff;
padding: 13px;
font-size: 13px;
font-family: Verdana, Arial;
position: absolute;
width: auto;
height: auto;
}

#menuSelect{
border: 1px solid #ffffff;
background-color: #ffffff;
padding: 13px;
font-size: 13px;
font-family: Verdana, Arial;
position: absolute;
width: auto;
height: auto;
}

</style>

<!–
Place the two <div>’s below in the <body> of your code.
(Normally, this will be immediately after the <body>
tag.) The menuShow div will contain your links; change
the text, links, and targets as needed.
//–>

<div id=”menuSelect”>
<a href=”#” onclick=”moveOnMenu();moveOffSelector()”>
<img border=”0″ width=”150″ src=”http://i39.tinypic.com/29pq7fc.gif” height=”50″/></a>
</div>
<div id=”menuShow”>
<a href=”#” onclick=”moveOffMenu();moveOnSelector()”>
<img border=”0″ width=”150″ src=”http://i39.tinypic.com/29pq7fc.gif” height=”50″/></a>
<br/>
<br/>
<a href=”http://www.codelifter.com”>Family Guy Season 1 </a><br/>
<a href=”http://www.codelifter.com”>Family Guy Season 2</a><br/>
<a href=”http://www.codelifter.com”>Family Guy Season 2</a><br/>

<a href=”http://www.codelifter.com”>Menu Item D</a><br/>
<a href=”http://www.codelifter.com”>Menu Item E</a><br/>

<a href=”http://www.codelifter.com”>Menu Item F</a><br/>
<a href=”http://www.codelifter.com”>Menu Item G</a><br/>
<a href=”http://www.codelifter.com”>Menu Item H</a><br/>

</div>

<!–
Put the following script immediately *after* the
<div>’s (above) in your page. Set the variables as
indicated in the script.
//–>

<script language=”JavaScript”>
<!– Original: David Sosnowski ([email protected]) –>
<!– Web Site: [url]http://www.codelifter.com[/url] –>

<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

<!– Begin
// (C) 2001 [url]www.CodeLifter.com[/url]
// [url]http://www.codelifter.com[/url]
// Free for all users, but leave in this header.

// Set Show to “yes” to show the menu on start-up.
// Set Show to “no” to show the selector on start-up.

Show =”yes”;

// Set OffX in pixels to a negative number
// somewhat larger than the width of the menu.

var OffX = -150;

// Set the PosX and PosY variables
// to the location on the screen where the
// menu should position (in pixels) when stopped.

var PosX = 250;
var PosY = 100;

// Usually, use the settings shown; but you can
// change the speed and the increment of motion
// across the screen, below.

var speed = 15;
var increment = 10;
var incrementNS4 = 5; // for slower NS4 browsers

// do not edit below this line
// ===========================

var is_NS = navigator.appName==”Netscape”;
var is_Ver = parseInt(navigator.appVersion);
var is_NS4 = is_NS&&is_Ver>=4&&is_Ver<5;
var is_NS5up = is_NS&&is_Ver>=5;

var MenuX = OffX;
var SelX = PosX;
var sPosX = PosX;
var sOffX = OffX;

if (Show == “yes”) {
sPosX = OffX;
sOffX = PosX;
MenuX = sOffX;
SelX = sPosX;
}

if (is_NS4) {
increment = incrementNS4;
Lq = “document.layers.”;
Sq = “”;
eval(Lq+’menuSelect’+Sq+’.left=sPosX’);
eval(Lq+’menuShow’+Sq+’.left=sOffX’);
eval(Lq+’menuSelect’+Sq+’.top=PosY’);
eval(Lq+’menuShow’+Sq+’.top=PosY’);
} else {
Lq = “document.all.”;
Sq = “.style”;
document.getElementById(‘menuSelect’).style.left = sPosX+”px”;
document.getElementById(‘menuShow’).style.left = sOffX+”px”;
document.getElementById(‘menuSelect’).style.top = PosY+”px”;
document.getElementById(‘menuShow’).style.top = PosY+”px”;
}

function moveOnMenu() {
if (MenuX < PosX) {
MenuX = MenuX + increment;
if (is_NS5up) {
document.getElementById(‘menuShow’).style.left = MenuX+”px”;
} else {
eval(Lq+’menuShow’+Sq+’.left=MenuX’);
}
setTimeout(‘moveOnMenu()’,speed);
}
}

function moveOffMenu() {
if (MenuX > OffX) {
MenuX = MenuX – increment;
if (is_NS5up) {
document.getElementById(‘menuShow’).style.left = MenuX+”px”;
} else {
eval(Lq+’menuShow’+Sq+’.left=MenuX’);
}
setTimeout(‘moveOffMenu()’,speed);
}
}

function moveOffSelector() {
if (SelX > OffX) {
SelX = SelX – increment;
if (is_NS5up) {
document.getElementById(‘menuSelect’).style.left = SelX+”px”;
} else {
eval(Lq+’menuSelect’+Sq+’.left=SelX’);
}
setTimeout(‘moveOffSelector()’,speed);
}
}

function moveOnSelector() {
if (SelX < PosX) {
SelX = SelX + increment;
if (is_NS5up) {
document.getElementById(‘menuSelect’).style.left = SelX+”px”;
} else {
eval(Lq+’menuSelect’+Sq+’.left=SelX’);
}
setTimeout(‘moveOnSelector()’,speed);
}
}
// End –>
</script>

<p><center>
<font face=”arial, helvetica” -2 size>Free JavaScripts provided<br/>
by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
</center><p>

<!– Script Size: 5.71 KB –>

document.write(d);

//–>

</p></p>

</!doctype>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@xxjack189authorMay 05.2009 — anyone?
×

Success!

Help @xxjack189 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.16,
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,
)...