Hi guys
I have 2 javascript functions, First I include which does swap images whenever I pass the mouse over a certain image -
<script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script>
-
then I wanted to include another function inside a table <td> tag that moves text in a way similar to marquee. -
<td>
-
<script language="JavaScript" type="text/JavaScript" src="includes/ScrollText.js"></script> </td>
-
Note that the swap image functions are used later in the table.
The problem is when ever I add the ScrollText.js the Swaping of images is disabled, as if ScrollText stoped MapScript from functioning
Any help?
4 2766
Hi guys
I have 2 javascript functions, First I include which does swap images whenever I pass the mouse over a certain image -
<script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script>
-
then I wanted to include another function inside a table <td> tag that moves text in a way similar to marquee. -
<td>
-
<script language="JavaScript" type="text/JavaScript" src="includes/ScrollText.js"></script> </td>
-
Note that the swap image functions are used later in the table.
The problem is when ever I add the ScrollText.js the Swaping of images is disabled, as if ScrollText stoped MapScript from functioning
Any help?
please post your javascript function(s) and the the html that calls these functions.
thank you
Ok
First is the HorizontalScoller.js file (I called it in my previous post as Scrolltext) -
var marqueewidth="770px"
-
var marqueeheight="30px"
-
var marqueespeed=1
-
var marqueebgcolor= "#F8FBD0"
-
var pauseit=1
-
-
var marqueecontent='<nobr><font size=2 color="#A05048" face="Arial"><b>Nos Bureau Sont Ouvert Du Lundi au Vendredi</b></font></nobr>'
-
-
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 align="center" 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>')
-
}
-
}
-
then the other function MapScript.js -
//*********************************************************************************
-
//
-
//*********************************************************************************
-
function PreloadImages(){
-
Image1 = new Image(210,251)
-
Image1.src = "images/map.gif"
-
-
Image2 = new Image(210,251)
-
Image2.src = "images/northon.gif"
-
-
Image3 = new Image(210,251)
-
Image3.src = "images/southon.gif"
-
-
Image4 = new Image(210,251)
-
Image4.src = "images/mlon.gif"
-
-
Image5 = new Image(210,251)
-
Image5.src = "images/beiruton.gif"
-
-
Image6 = new Image(210,251)
-
Image6.src = "images/bekaa1on.gif"
-
}
-
-
//*********************************************************************************
-
//
-
//*********************************************************************************
-
function original() {
-
target= document.getElementById("MyMap");
-
target.style.filter="blendTrans(duration=1)"
-
target.filters[0].Apply(); // apply the filter
-
target.filters[0].Play(); // play the filter
-
document.images.MyMap.src = Image1.src; return true;
-
}
-
-
function SwapNorthOn() {
-
target= document.getElementById("MyMap");
-
target.style.filter="blendTrans(duration=1)"
-
target.filters[0].Apply(); // apply the filter
-
target.filters[0].Play(); // play the filter
-
document.images.MyMap.src = Image2.src; return true;
-
}
-
-
function SwapSouthOn() {
-
target= document.getElementById("MyMap");
-
target.style.filter="blendTrans(duration=1)"
-
target.filters[0].Apply(); // apply the filter
-
target.filters[0].Play(); // play the filter
-
document.images.MyMap.src = Image3.src; return true;
-
}
-
-
function SwapMLOn() {
-
target= document.getElementById("MyMap");
-
target.style.filter="blendTrans(duration=1)"
-
target.filters[0].Apply(); // apply the filter
-
target.filters[0].Play(); // play the filter
-
document.images.MyMap.src = Image4.src; return true;
-
}
-
-
function SwapBeirutOn() {
-
target= document.getElementById("MyMap");
-
target.style.filter="blendTrans(duration=1)"
-
target.filters[0].Apply(); // apply the filter
-
target.filters[0].Play(); // play the filter
-
document.images.MyMap.src = Image5.src; return true;
-
}
-
-
function SwapBekaaOn() {
-
target= document.getElementById("MyMap");
-
target.style.filter="blendTrans(duration=1)"
-
target.filters[0].Apply(); // apply the filter
-
target.filters[0].Play(); // play the filter
-
document.images.MyMap.src = Image6.src; return true;
-
}
-
-
-
//
-
//
-
//
-
var myLinks = [
-
"http://www.google.com", "http://www.yahoo.com",
-
"http://www.altavista.com", "http://www.microsoft.com", "http://www.yahoo.fr"];
-
var myCaption = ["Les Facultés à Tripoli","Les Facultés au Mont Liban",
-
"Les Facultés à Beyrouth","Les Facultés Sud","Les Facultés au Bekaa"]
-
var myTexts = [
-
"<b><font color=#A75D3C>Faculte de droit, Tripoli<br>Faculte des sciences, Tripoli <br>Faculte de medecine, Tripoli</font></b>",
-
"<b><font color=#A75D3C>Faculte de droit, Mont Liban <br>Faculte des sciences, Mont Liban <br>Faculte de medecine, Mont Liban</font></b>",
-
"<b><font color=#A75D3C>Faculte de droit Beyrouth <br>Faculte des sciences, Beyrouth <br>Faculte de medecine, Beyrouth</font></b>",
-
"<b><font color=#A75D3C>Faculte de droit South <br>Faculte des sciences, South <br>Faculte de medecine, South</font></b>",
-
"<b><font color=#A75D3C>Faculte de droit Bekaa <br>Faculte des sciences, Bekaa <br>Faculte de medecine, Bekaa</font></b>",
-
];
-
var k = 0;
-
-
function chgLink(x)
-
{
-
var el = document2.getElementById(1);
-
el.innerHTML = myTexts[x];
-
el.title = myCaption[x];
-
el.href = myLinks[x];
-
-
}
-
-
then the HTML that calls them: - :
-
<html>
-
<head>
-
....
-
<script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script>
-
</head>
-
<body onLoad="PreloadImages();" bgcolor="#F8FBD0">
-
-
<table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
-
<tr>
-
<td valign="top">
-
<center>
-
<table cellpadding="0" cellspacing="0" width="765" height="100%" border="0">
-
<tr>
-
<td valign="top">
-
<table cellpadding="0" cellspacing="0" width="765" border="0" ID="Table1">
-
<tr>
-
... </tr>
-
</table>
-
<table cellpadding="0" cellspacing="0" width="765" border="0" ID="Table11">
-
<tr>
-
<td valign="top" align="center">
-
<script language="JavaScript" type="text/JavaScript" src="includes/HorizontalScroller.js"></script>
-
</td>
-
.... <script type='text/javascript' src='includes/exmplmenu2_var.js'></script></td>
-
<td>
-
<script type='text/javascript' src='includes/menu_com.js'></script>
-
</td>
-
<td>
-
<noscript>Votre naviguateur ne supporte pas les scripts</noscript>
-
</td>
-
</tr>
-
</table>
-
<table cellpadding="0" cellspacing="0" width="100%" border="0" ID="Table3" style="margin-top:90px;">
-
<tr>
-
<td align="center" valign = top width="40%">
-
<font color="#A75D3C">.....</b><br>
-
....
-
<img id="MyMap" src="images/map.gif" border="0" width="210" height="251" usemap="#ahmad" name="MyMap">
-
...... Call some map functions......
-
</table>
-
-
</body>
-
</html>
-
the problem that your expericing usually happens when an error happens and it halts everything, i'll still looking through it i'll post anything i find...oh is this code online? it would make it easier to debug.
Thank you for your concern.
I was trying to upload the files into my personal website, and it was assumed that index2 will not function because it includes MapScript javascript and Horizontol Script.js. while index3 should function properly (map changes) , But unfortunatly both are not swaping now, I assume because the freeservers website includes a lot of scripts. and obviously they are defecting that of MapScript.
both scripts
http://mohammedtleis.8m.com/index2.html
one script
http://mohammedtleis.8m.com/index3.html
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |