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 2791 epots9 1,351
Recognized Expert Top Contributor
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 HorizontalScoll er.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>
-
epots9 1,351
Recognized Expert Top Contributor
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.8 m.com/index2.html
one script
http://mohammedtleis.8 m.com/index3.html
Sign in to post your reply or Sign up for a free account.
Similar topics |
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
| |
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |