473,790 Members | 2,380 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

include a javascript disable the function of another

10 New Member
Hi guys

I have 2 javascript functions, First I include which does swap images whenever I pass the mouse over a certain image

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script>
  2.  
then I wanted to include another function inside a table <td> tag that moves text in a way similar to marquee.

Expand|Select|Wrap|Line Numbers
  1. <td> 
  2. <script language="JavaScript" type="text/JavaScript" src="includes/ScrollText.js"></script> </td>
  3.  
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?
Jul 24 '07 #1
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

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script>
  2.  
then I wanted to include another function inside a table <td> tag that moves text in a way similar to marquee.

Expand|Select|Wrap|Line Numbers
  1. <td> 
  2. <script language="JavaScript" type="text/JavaScript" src="includes/ScrollText.js"></script> </td>
  3.  
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
Jul 24 '07 #2
pythoNewbie
10 New Member
Ok
First is the HorizontalScoll er.js file (I called it in my previous post as Scrolltext)

Expand|Select|Wrap|Line Numbers
  1. var marqueewidth="770px"
  2. var marqueeheight="30px"
  3. var marqueespeed=1
  4. var marqueebgcolor= "#F8FBD0" 
  5. var pauseit=1
  6.  
  7. var marqueecontent='<nobr><font size=2 color="#A05048" face="Arial"><b>Nos Bureau Sont Ouvert Du Lundi au Vendredi</b></font></nobr>'
  8.  
  9. marqueespeed=(document.all)? marqueespeed : Math.max(1, marqueespeed-1) //slow speed down by 1 for NS
  10. var copyspeed=marqueespeed
  11. var pausespeed=(pauseit==0)? copyspeed: 0
  12. var iedom=document.all||document.getElementById
  13. if (iedom)
  14. document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
  15. var actualwidth=''
  16. var cross_marquee, ns_marquee
  17.  
  18. function populate(){
  19. if (iedom){
  20. cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
  21. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  22. cross_marquee.innerHTML=marqueecontent
  23. actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
  24. }
  25. else if (document.layers){
  26. ns_marquee=document.ns_marquee.document.ns_marquee2
  27. ns_marquee.left=parseInt(marqueewidth)+8
  28. ns_marquee.document.write(marqueecontent)
  29. ns_marquee.document.close()
  30. actualwidth=ns_marquee.document.width
  31. }
  32. lefttime=setInterval("scrollmarquee()",20)
  33. }
  34. window.onload=populate
  35.  
  36. function scrollmarquee(){
  37. if (iedom){
  38. if (parseInt(cross_marquee.style.left)>(actualwidth*(-1)+8))
  39. cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
  40. else
  41. cross_marquee.style.left=parseInt(marqueewidth)+8+"px"
  42.  
  43. }
  44. else if (document.layers){
  45. if (ns_marquee.left>(actualwidth*(-1)+8))
  46. ns_marquee.left-=copyspeed
  47. else
  48. ns_marquee.left=parseInt(marqueewidth)+8
  49. }
  50. }
  51.  
  52. if (iedom||document.layers){
  53. with (document){
  54. document.write('<table align="center" border="0" cellspacing="0" cellpadding="0"><td>')
  55. if (iedom){
  56. write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
  57. write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
  58. write('<div id="iemarquee" style="position:absolute;left:0px;top:0px"></div>')
  59. write('</div></div>')
  60. }
  61. else if (document.layers){
  62. write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
  63. write('<layer name="ns_marquee2" left=0 top=0 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
  64. write('</ilayer>')
  65. }
  66. document.write('</td></table>')
  67. }
  68. }
  69.  
then the other function MapScript.js
Expand|Select|Wrap|Line Numbers
  1. //*********************************************************************************
  2. //
  3. //*********************************************************************************
  4. function PreloadImages(){
  5.     Image1 = new Image(210,251)
  6.     Image1.src = "images/map.gif"
  7.  
  8.     Image2 = new Image(210,251)
  9.     Image2.src = "images/northon.gif"
  10.  
  11.     Image3 = new Image(210,251)
  12.     Image3.src = "images/southon.gif"
  13.  
  14.     Image4 = new Image(210,251)
  15.     Image4.src = "images/mlon.gif"
  16.  
  17.     Image5 = new Image(210,251)
  18.     Image5.src = "images/beiruton.gif" 
  19.  
  20.     Image6 = new Image(210,251)
  21.     Image6.src = "images/bekaa1on.gif" 
  22. }
  23.  
  24. //*********************************************************************************
  25. //
  26. //*********************************************************************************
  27. function original() {
  28. target= document.getElementById("MyMap");
  29. target.style.filter="blendTrans(duration=1)"
  30. target.filters[0].Apply();  // apply the filter
  31. target.filters[0].Play();   // play the filter
  32. document.images.MyMap.src = Image1.src; return true; 
  33. }
  34.  
  35. function SwapNorthOn() {
  36. target= document.getElementById("MyMap");
  37. target.style.filter="blendTrans(duration=1)"
  38. target.filters[0].Apply();  // apply the filter
  39. target.filters[0].Play();   // play the filter
  40. document.images.MyMap.src = Image2.src; return true;
  41. }
  42.  
  43. function SwapSouthOn() {
  44. target= document.getElementById("MyMap");
  45. target.style.filter="blendTrans(duration=1)"
  46. target.filters[0].Apply();  // apply the filter
  47. target.filters[0].Play();   // play the filter
  48. document.images.MyMap.src = Image3.src; return true;
  49. }
  50.  
  51. function SwapMLOn() {
  52. target= document.getElementById("MyMap");
  53. target.style.filter="blendTrans(duration=1)"
  54. target.filters[0].Apply();  // apply the filter
  55. target.filters[0].Play();   // play the filter
  56. document.images.MyMap.src = Image4.src; return true;
  57. }
  58.  
  59. function SwapBeirutOn() {
  60. target= document.getElementById("MyMap");
  61. target.style.filter="blendTrans(duration=1)"
  62. target.filters[0].Apply();  // apply the filter
  63. target.filters[0].Play();   // play the filter
  64. document.images.MyMap.src = Image5.src; return true;
  65. }
  66.  
  67. function SwapBekaaOn() {
  68. target= document.getElementById("MyMap");
  69. target.style.filter="blendTrans(duration=1)"
  70. target.filters[0].Apply();  // apply the filter
  71. target.filters[0].Play();   // play the filter
  72. document.images.MyMap.src = Image6.src; return true;
  73. }
  74.  
  75.  
  76. //
  77. //
  78. //
  79. var myLinks = [
  80. "http://www.google.com", "http://www.yahoo.com",
  81. "http://www.altavista.com", "http://www.microsoft.com", "http://www.yahoo.fr"];
  82. var myCaption = ["Les Facultés à Tripoli","Les Facultés au Mont Liban",
  83.                  "Les Facultés à Beyrouth","Les Facultés Sud","Les Facultés au Bekaa"]
  84. var myTexts = [
  85. "<b><font color=#A75D3C>Faculte de droit, Tripoli<br>Faculte des sciences, Tripoli <br>Faculte de medecine, Tripoli</font></b>",
  86. "<b><font color=#A75D3C>Faculte de droit, Mont Liban <br>Faculte des sciences, Mont Liban <br>Faculte de medecine, Mont Liban</font></b>",
  87. "<b><font color=#A75D3C>Faculte de droit Beyrouth <br>Faculte des sciences, Beyrouth <br>Faculte de medecine, Beyrouth</font></b>", 
  88. "<b><font color=#A75D3C>Faculte de droit South <br>Faculte des sciences, South <br>Faculte de medecine, South</font></b>", 
  89. "<b><font color=#A75D3C>Faculte de droit Bekaa <br>Faculte des sciences, Bekaa <br>Faculte de medecine, Bekaa</font></b>", 
  90. ];
  91. var k = 0;
  92.  
  93. function chgLink(x)
  94. {
  95. var el = document2.getElementById(1);
  96. el.innerHTML = myTexts[x]; 
  97. el.title = myCaption[x];
  98. el.href = myLinks[x];
  99.  
  100. }
  101.  
  102.  
then the HTML that calls them:
Expand|Select|Wrap|Line Numbers
  1. :
  2. <html>
  3. <head>
  4. .... 
  5. <script language="JavaScript" type="text/JavaScript" src="includes/MapScript.js"></script>
  6. </head>
  7. <body onLoad="PreloadImages();" bgcolor="#F8FBD0">
  8.  
  9. <table cellpadding="0" cellspacing="0" width="100%" height="100%" border="0">
  10.     <tr>
  11. <td valign="top">
  12. <center>
  13.             <table cellpadding="0" cellspacing="0" width="765" height="100%" border="0">
  14.                 <tr>
  15.                     <td valign="top">
  16.                         <table cellpadding="0" cellspacing="0" width="765" border="0" ID="Table1">
  17.                             <tr>
  18.                             ...                            </tr>
  19.                         </table>
  20.                                                 <table cellpadding="0" cellspacing="0" width="765" border="0" ID="Table11">
  21.                             <tr>
  22.  <td valign="top" align="center">
  23. <script language="JavaScript" type="text/JavaScript" src="includes/HorizontalScroller.js"></script> 
  24. </td>
  25. ....                                    <script type='text/javascript' src='includes/exmplmenu2_var.js'></script></td>
  26.                                 <td>
  27.                                     <script type='text/javascript' src='includes/menu_com.js'></script>
  28.                                 </td>
  29.                                 <td>
  30.                                     <noscript>Votre naviguateur ne supporte pas les scripts</noscript>
  31.                                 </td>
  32.                             </tr>
  33.                         </table>
  34.                         <table cellpadding="0" cellspacing="0" width="100%" border="0" ID="Table3" style="margin-top:90px;">
  35.                             <tr>
  36.                                 <td  align="center" valign = top width="40%">
  37.                                     <font color="#A75D3C">.....</b><br>
  38. ....
  39.         <img id="MyMap" src="images/map.gif" border="0" width="210" height="251" usemap="#ahmad" name="MyMap"> 
  40.                             ...... Call some map functions......
  41. </table>
  42.  
  43. </body>
  44. </html>
  45.  
Jul 24 '07 #3
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.
Jul 24 '07 #4
pythoNewbie
10 New Member
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
Jul 25 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
9666
marktang
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...
0
10200
jinu1996
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...
1
10145
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,...
0
9021
agi2029
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...
1
7530
isladogs
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...
0
6769
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();...
0
5422
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...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
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

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.