473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Cannot understand some code in Dropdown menu script!!!

32
Hi All,
I have taken from net dropdown menu script understood it but not completely.
below is html file

but there i dont know the isContained function role. Can anyone help me undertand this function. files are attached in zip format
I will your responses. Thanks in advance
Attached Files
File Type: zip sdesing.zip (76.1 KB, 81 views)
Aug 16 '13 #1
7 1629
Rabbit
12,516 Expert Mod 8TB
As a rule of thumb, I do not open attachments from strangers. Please post the code in the thread itself. And use code tags when you do.
Aug 16 '13 #2
azegurb
32
the js.file
Expand|Select|Wrap|Line Numbers
  1. var cssdropdown={
  2. disappeardelay: 1050,
  3. dropdownindicator: '<img src="down.gif" border="0" />', 
  4. enablereveal: [true, 35],
  5. enableiframeshim: 1, 
  6.  
  7.  
  8. dropmenuobj: null, asscmenuitem: null, domsupport: document.all || document.getElementById, standardbody: null, iframeshimadded: false, revealtimers: {},
  9.  
  10. getposOffset:function(what, offsettype){
  11.     var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
  12.     var parentEl=what.offsetParent;
  13.      while (parentEl!=null){
  14.         totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
  15.         parentEl=parentEl.offsetParent;
  16.     }
  17.  
  18.  
  19.     return totaloffset;
  20. },
  21.  
  22. css:function(el, targetclass, action){
  23.     var needle=new RegExp("(^|\\s+)"+targetclass+"($|\\s+)", "ig")
  24.     if (action=="check")
  25.         return needle.test(el.className)
  26.     else if (action=="remove")
  27.         el.className=el.className.replace(needle, "")
  28.     else if (action=="add" && !needle.test(el.className))
  29.         el.className+=" "+targetclass
  30. },
  31.  
  32. showmenu:function(dropmenu, e){
  33.     if (this.enablereveal[0]){
  34.         if (!dropmenu._trueheight || dropmenu._trueheight<10){
  35.         alert('verilmeyib');
  36.             dropmenu._trueheight=dropmenu.offsetHeight
  37.             }
  38.  
  39.         alert(this.revealtimers[dropmenu.id]);
  40.         clearTimeout(this.revealtimers[dropmenu.id])
  41.         dropmenu.style.height=dropmenu._curheight=0
  42.         dropmenu.style.overflow="hidden"
  43.         dropmenu.style.visibility="visible"
  44.         this.revealtimers[dropmenu.id]=setInterval(function(){cssdropdown.revealmenu(dropmenu)}, 10)
  45.     }
  46.     else{
  47.         dropmenu.style.visibility="visible"
  48.     }
  49.     this.css(this.asscmenuitem, "selected", "add")
  50. },
  51.  
  52. revealmenu:function(dropmenu, dir){
  53.     var curH=dropmenu._curheight, maxH=dropmenu._trueheight, steps=this.enablereveal[1]
  54.     if (curH<maxH){
  55.         var newH=Math.min(curH, maxH)
  56.         dropmenu.style.height=newH+"px"
  57.         dropmenu._curheight= newH + Math.round((maxH-newH)/steps) + 1
  58.  
  59.     }
  60.     alert(dropmenu._curheight);
  61.         dropmenu.style.height="auto"
  62.         dropmenu.style.overflow="hidden"
  63.         clearInterval(this.revealtimers[dropmenu.id])
  64.     }
  65. },
  66.  
  67. clearbrowseredge:function(obj, whichedge){
  68.     var edgeoffset=0
  69.     if (whichedge=="rightedge"){
  70.         var windowedge=document.all && !window.opera? this.standardbody.scrollLeft+this.standardbody.clientWidth-15 : window.pageXOffset+window.innerWidth-15
  71.         var dropmenuW=this.dropmenuobj.offsetWidth
  72.         if (windowedge-this.dropmenuobj.x < dropmenuW)  //move menu to the left?
  73.             edgeoffset=dropmenuW-obj.offsetWidth
  74.     }
  75.     else{
  76.         var topedge=document.all && !window.opera? this.standardbody.scrollTop : window.pageYOffset
  77.         var windowedge=document.all && !window.opera? this.standardbody.scrollTop+this.standardbody.clientHeight-15 : window.pageYOffset+window.innerHeight-18
  78.         var dropmenuH=this.dropmenuobj._trueheight
  79.         if (windowedge-this.dropmenuobj.y < dropmenuH){ //move up?
  80.             edgeoffset=dropmenuH+obj.offsetHeight
  81.             if ((this.dropmenuobj.y-topedge)<dropmenuH) //up no good either?
  82.                 edgeoffset=this.dropmenuobj.y+obj.offsetHeight-topedge
  83.         }
  84.     }
  85.     return edgeoffset
  86. },
  87.  
  88. dropit:function(obj, e, dropmenuID){
  89.     if (this.dropmenuobj!=null) //hide previous menu
  90.         this.hidemenu() //hide menu
  91.     this.clearhidemenu()
  92.     this.dropmenuobj=document.getElementById(dropmenuID) //reference drop down menu
  93.     this.asscmenuitem=obj //reference associated menu item
  94.     this.showmenu(this.dropmenuobj, e)
  95.     this.dropmenuobj.x=this.getposOffset(obj, "left") //this.getposOffset(startchrome, "lef")
  96.     this.dropmenuobj.y=this.getposOffset(obj, "top")
  97.     this.dropmenuobj.style.left=this.dropmenuobj.x -this.clearbrowseredge(obj, "rightedge")+"px"
  98.     this.dropmenuobj.style.top=this.dropmenuobj.y -this.clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+1+"px"
  99.     this.positionshim() //call iframe shim function
  100. },
  101.  
  102. positionshim:function(){ //display iframe shim function
  103.     if (this.iframeshimadded){
  104.         if (this.dropmenuobj.style.visibility=="visible"){
  105.             this.shimobject.style.width=this.dropmenuobj.offsetWidth+"px"
  106.             this.shimobject.style.height=this.dropmenuobj._trueheight+"px"
  107.             this.shimobject.style.left=parseInt(this.dropmenuobj.style.left)+"px"
  108.             this.shimobject.style.top=parseInt(this.dropmenuobj.style.top)+"px"
  109.             this.shimobject.style.display="block"
  110.         }
  111.     }
  112. },
  113.  
  114. hideshim:function(){
  115.     if (this.iframeshimadded)
  116.         this.shimobject.style.display='none'
  117. },
  118.  
  119. isContained:function(m, e){
  120.     var e=window.event || e
  121.     var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
  122.     while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
  123.     if (c==m)
  124.         return true
  125.     else
  126.         return false
  127. },
  128.  
  129. dynamichide:function(m, e){
  130. if (!this.isContained(m, e)){
  131.         this.delayhidemenu()
  132.     }
  133. },
  134.  
  135. delayhidemenu:function(){
  136.     this.delayhide=setTimeout("cssdropdown.hidemenu()", this.disappeardelay) //hide menu
  137. },
  138.  
  139. hidemenu:function(){
  140.     this.css(this.asscmenuitem, "selected", "remove")
  141.     this.dropmenuobj.style.visibility='hidden'
  142.     this.dropmenuobj.style.left=this.dropmenuobj.style.top="-1000px"
  143.     this.hideshim()
  144. },
  145.  
  146. clearhidemenu:function(){
  147.     if (this.delayhide!="undefined")
  148.         clearTimeout(this.delayhide)
  149. },
  150.  
  151. addEvent:function(target, functionref, tasktype){
  152.     if (target.addEventListener)
  153.         target.addEventListener(tasktype, functionref, false);
  154.     else if (target.attachEvent)
  155.         target.attachEvent('on'+tasktype, function(){return functionref.call(target, window.event)});
  156. },
  157.  
  158. startchrome:function(){
  159.     if (!this.domsupport)
  160.         return
  161.     this.standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body
  162.     for (var ids=0; ids<arguments.length; ids++){
  163.  
  164.         var menuitems=document.getElementById(arguments[ids]).getElementsByTagName("a")
  165.  
  166.         for (var i=0; i<menuitems.length; i++){
  167.             if (menuitems[i].getAttribute("rel")){
  168.                 var relvalue=menuitems[i].getAttribute("rel")
  169.                 var asscdropdownmenu=document.getElementById(relvalue)
  170.                 this.addEvent(asscdropdownmenu, function(){cssdropdown.clearhidemenu()}, "mouseover")
  171.                 this.addEvent(asscdropdownmenu, function(e){cssdropdown.dynamichide(this, e)}, "mouseout")
  172.                 this.addEvent(asscdropdownmenu, function(){cssdropdown.delayhidemenu()}, "click")
  173.                 try{
  174.                     menuitems[i].innerHTML=menuitems[i].innerHTML+"      vdgdgf"+cssdropdown.dropdownindicator
  175.                 }catch(e){}
  176.                 this.addEvent(menuitems[i], function(e){
  177.  
  178.                     if (!cssdropdown.isContained(this, e)){
  179.                         var evtobj=window.event || e
  180.  
  181.                         cssdropdown.dropit(this, evtobj, this.getAttribute("rel"))
  182.                         var az=document.getElementById('xrom').getElementsByTagName("a")[3].innerHTML;
  183.                     //  alert(this.innerHTML==az);
  184.                     }
  185.                 }, "mouseover")
  186.                 this.addEvent(menuitems[i], function(e){cssdropdown.dynamichide(this, e)}, "mouseout") //hide drop down menu when main menu items are mouse out
  187.                 this.addEvent(menuitems[i], function(){cssdropdown.delayhidemenu()}, "click") //hide drop down menu when main menu items are clicked on
  188.             }
  189.         } //end inner for
  190.     } //end outer for
  191.     if (this.enableiframeshim && document.all && !window.XDomainRequest && !this.iframeshimadded){ //enable iframe shim in IE5.5 thru IE7?
  192.         document.write('<IFRAME id="iframeshim" src="about:blank" frameBorder="0" scrolling="no" style="left:0; top:0; position:absolute; display:none;z-index:90; background: transparent;"></IFRAME>')
  193.         this.shimobject=document.getElementById("iframeshim") //reference iframe object
  194.         this.shimobject.style.filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)'
  195.         this.iframeshimadded=true
  196.     }
  197. }
  198.  
  199. }
  200.  
the css file
Expand|Select|Wrap|Line Numbers
  1. .chromestyle{
  2. width: 100%;
  3. font-weight: bold;
  4. }
  5.  
  6. .chromestyle:after{ /*Add margin between menu and rest of content in Firefox*/
  7.  content: "."; 
  8. display: block; 
  9. height: 0; 
  10. clear: both; 
  11. visibility: hidden;
  12. }
  13.  
  14. .chromestyle ul{
  15. border: 1px solid #BBB;
  16. width: 100%;
  17. background: url(chromebg.gif) center center repeat-x; /*THEME CHANGE HERE*/
  18. padding: 4px 0;
  19. margin: 0;
  20. text-align: center; /*set value to "left", "center", or "right"*/
  21. }
  22.  
  23. .chromestyle ul li{
  24. display:inline;
  25. }
  26.  
  27.  
  28. .chromestyle ul li a{
  29. color: #494949;
  30. padding: 4px 7px;
  31. margin: 0;
  32. text-decoration: none;
  33. border-right: 1px solid #DADADA;
  34. }
  35. .dropmenudiv{
  36. position:absolute;
  37. top: 0;
  38. border: 1px solid #BBB; /*THEME CHANGE HERE*/
  39. border-bottom-width: 0;
  40. font:normal 12px Verdana;
  41. line-height:18px;
  42. z-index:100;
  43. background-color: white;
  44. width: 200px;
  45. visibility: visible;
  46. }
  47. .dropmenudiv a{
  48. width: auto;
  49. display: block;
  50. text-indent: 3px;
  51. border-bottom: 1px solid #BBB; 
  52. padding: 2px 0;
  53. text-decoration: none;
  54. font-weight: bold;
  55. color: black;
  56. }
  57.  
the html file
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml"><head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <title>Bakı İstehsalat Tikinti Şirkəti</title>
  5. <script src="jquery.js" type="text/javascript" charset="utf-8"></script>
  6.  
  7. <link rel="stylesheet" href="css/nivo-slider.css" type="text/css" media="screen" />
  8. <style type="text/css">
  9. body {
  10.     padding: 0;
  11.     margin: 0;
  12.     background: #f3efd4 url(yeni.jpg) no-repeat center top;
  13.     color: #333333;
  14.     width: 100%;
  15.     display: table;
  16.         height:900px;
  17. }
  18. #content {
  19.     width: 1024px;
  20.     margin: 5px auto 0px;
  21.         background-color:#fff;
  22.         height:900px;
  23.     border: solid 1px #ccc;
  24.     padding: 0px 0px 0px 0px;
  25. }
  26. h1 {
  27.     margin: 0;
  28.     padding: 0;
  29. }
  30. </style>
  31. <link rel="stylesheet" type="text/css" href="S%20Design_files/chromestyle.css">
  32.  
  33. <script type="text/javascript" src="S%20Design_files/chrome.js">
  34. </script>
  35.  
  36. <link rel="stylesheet" href="S%20Design_files/style.css">
  37.  
  38.  
  39. </head>
  40.  
  41. <body>
  42. <div id="content"><div><img src="S%20Design_files/top.jpg"></div>
  43.     <div class="chromestyle" id="xrom">
  44. <ul>
  45. <li><a href="http://www.dynamicdrive.com/">Main</a></li>
  46. <li><a class="" href="#" rel="dropmenu1">Gallery</a></li>
  47. <li><a class="" href="#" rel="dropmenu2">Partners</a></li>
  48. <li><a class="" href="#" rel="dropmenu3">About us</a></li>
  49. <li><a class="" href="#" rel="dropmenu4">Contact</a></li>
  50. <li><a class="" href="#" rel="dropmenu5">Map</a></li>
  51. </ul>
  52. </div>
  53.  
  54. <!--1st drop down menu -->                                                   
  55. <div style="height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;" id="dropmenu1" class="dropmenudiv">
  56. <a href="http://www.dynamicdrive.com/"></a>
  57. <a href="http://www.cssdrive.com/">Флористика</a>
  58.  
  59. </div>
  60.  
  61.  
  62. <!--2nd drop down menu -->                                                
  63. <div id="dropmenu2" class="dropmenudiv" style="width: 150px; height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;">
  64. <a href="http://www.cnn.com/"></a>
  65. </div>
  66.  
  67. <!--3rd drop down menu -->                                                   
  68. <div id="dropmenu3" class="dropmenudiv" style="width: 150px; height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;">
  69. <a href="http://www.google.com/">saasaa</a>
  70. </div>
  71. <div id="dropmenu4" class="dropmenudiv" style="width: 150px; height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;">
  72. <a href="">Национальный декор</a>
  73. <a href="">Новогодний декор</a>
  74. <a href="">Детский праздник</a>
  75. </div>
  76. <div id="dropmenu5" class="dropmenudiv" style="width: 150px; height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;">
  77. <a href=""></a>
  78. </div>
  79. <div id="dropmenu3" class="dropmenudiv" style="width: 150px;">
  80. <a href="">Контакты</a>
  81.  
  82. </div>
  83.     <script type="text/javascript">
  84.  
  85. cssdropdown.startchrome("xrom")
  86.  
  87.  
  88. </script>
  89.  
  90. <div id="slider-wrapper">
  91.    <div id="slider" class="nivoSlider">
  92.       <img src="images/1.jpg" alt="" title="" />
  93.       <a href="#"><img src="images/2.jpg" alt="" title="" /></a>
  94.       <img src="images/3.jpg" alt="" title=""  />
  95.        <img src="images/4.jpg" alt="" title="" />
  96.             </div>
  97.  
  98.  
  99.      </div>
  100.     <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
  101.     <script type="text/javascript">
  102.     $(window).load(function() {
  103.         $('#slider').nivoSlider();
  104.     });
  105.     </script>    <p style="padding-bottom: 0px"> </p>  </div>
  106. </body></html>
  107.  
thanks for attention
Aug 17 '13 #3
Rabbit
12,516 Expert Mod 8TB
The isContained function basically returns true is the triggering event's triggering element is contained within another given element.
Aug 18 '13 #4
azegurb
32
I dont undertand what is triggering event's triggering element. i know triggering event for ex:mouseover but i dont know what is triggering event's triggering element?
And i created mine. but it doesn't work well like the script before i posted. the code i wrote is below. it works normally, but when i quickly move coursor on and out some of the dropdown menu crashes.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.     "http://www.w3.org/TR/html4/loose.dtd">
  3. <html lang="en">
  4. <head>
  5.     <title><!-- Insert your title here --></title>
  6.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7.     <style>
  8.     #esas {
  9.  
  10.         height:300px;
  11.         width:200px;
  12.         background-color:red;
  13.         margin-top:20px;
  14.     }
  15.  
  16.     </style>
  17.     <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
  18.     <script>
  19. window.onload=function(){
  20.     var delayhide="";
  21.     function pos(obyekt){
  22.         var obj=obyekt.getAttribute('rel');
  23.         var get=document.getElementById(obj);
  24.         var left=obyekt.offsetLeft;
  25.         var top=obyekt.offsetTop;
  26.         var hun=obyekt.offsetHeight;
  27.        open(get);
  28.       get.style.left=left +"px"
  29.     get.style.top=top +hun+1+"px"
  30.  
  31.     }
  32.     function unpos(obyekt){
  33.     delayhide=setTimeout(function(){del(obyekt)}, 50);
  34.     }
  35.  
  36. function unpos1(obyekt){
  37.     delayhide=setTimeout(function(){sil1(obyekt)}, 500);
  38.     }
  39.     function del(obyekt){
  40.     var obj=obyekt.getAttribute('rel');
  41.     var get=document.getElementById(obj);
  42.     var left=-1000;
  43.     var top=-1000;
  44.       get.style.left=left +"px"
  45.     get.style.top=top +"px"
  46.  
  47.  
  48.     }
  49.     function sil1(obyekt){
  50.       var obj=obyekt;  
  51.        var left=-1000;
  52.         var top=-1000;
  53.      obj.style.left=left +"px"
  54.     obj.style.top=top +"px"
  55. }
  56.  
  57.     function open(dropmenu){
  58.  
  59.         if (!dropmenu._trueheight || dropmenu._trueheight<10){
  60.         dropmenu._trueheight=dropmenu.offsetHeight
  61.         }
  62.         dropmenu.style.height=dropmenu._curheight=0
  63.         dropmenu.style.overflow="hidden"
  64.         dropmenu.style.visibility="visible"
  65.         //this.revealtimers[dropmenu.id]=
  66.         timer=setInterval(function(){ac(dropmenu)}, 10)
  67.  
  68.  
  69.     }
  70. function ac(dropmenu){
  71.  
  72.     var curH=dropmenu._curheight, maxH=dropmenu._trueheight, steps=15;
  73.     if (curH<maxH){
  74.         var newH=Math.min(curH, maxH)
  75.         dropmenu.style.height=newH+"px"
  76.         dropmenu._curheight= newH + Math.round((maxH-newH)/steps) + 1
  77.     }
  78.     else{ 
  79.         dropmenu.style.height="auto"
  80.         dropmenu.style.overflow="hidden"
  81.         clearInterval(timer);
  82.     }
  83.     }
  84.    var menuitems=document.getElementById('xrom').getElementsByTagName("a");
  85.    function bax(){
  86.     for (var i=0; i<menuitems.length; i++){
  87.     if (menuitems[i].getAttribute("rel")){
  88.     var gotur=menuitems[i].getAttribute("rel");
  89.     var id=document.getElementById(gotur);
  90.     id.onmouseover=function(){  clearTimeout(delayhide);}
  91.     id.onmouseout=function(){   unpos1(this);}
  92.     menuitems[i].onmouseover=function(){pos(this);}
  93.     menuitems[i].onmouseout=function(){unpos(this);}
  94.     }
  95.    }
  96.    }
  97.  
  98.    bax()
  99.    }
  100.  
  101.    </script>
  102. </head>
  103. <body>
  104.    <div class="chromestyle" id="xrom">
  105. <ul>
  106. <li><a href="http://www.dynamicdrive.com/">Main</a></li>
  107. <li><a class="" href="#" rel="dropmenu1">Gallery</a></li>
  108. <li><a class="" href="#" rel="dropmenu2">Partners</a></li>
  109. <li><a class="" href="#" rel="dropmenu3">About Us</a></li>
  110. <li><a class="" href="#" rel="dropmenu4">Contact</a></li>
  111. <li><a class="" href="#">Map</a></li>
  112. </ul>
  113. </div>
  114. <div id="dropmenu1" class="dropmenudiv" style="width: 150px; height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;">
  115. <a href="">Национальный декор</a>
  116. <a href="">Новогодний декор</a>
  117. <a href="">Детский праздник</a>
  118. </div>
  119. <div id="dropmenu2" class="dropmenudiv" style="width: 150px; height: auto; overflow: hidden; visibility: hidden; left: -1000px; top: -1000px;">
  120. <a href="">Национальный декор</a>
  121. <a href="">Новогодний декор</a>
  122. <a href="">Детский праздник</a>
  123. </div>
  124.  <input type="button" value="yaz">
  125. </body>
  126. </html>
  127.  
and the css file
Expand|Select|Wrap|Line Numbers
  1. .chromestyle{
  2. width: 100%;
  3. font-weight: bold;
  4. }
  5.  
  6. .chromestyle:after{ /*Add margin between menu and rest of content in Firefox*/
  7.  content: "."; 
  8. display: block; 
  9. height: 0; 
  10. clear: both; 
  11. visibility: hidden;
  12. }
  13.  
  14. .chromestyle ul{
  15. border: 1px solid #BBB;
  16. width: 100%;
  17. background: url(chromebg.gif) center center repeat-x; /*THEME CHANGE HERE*/
  18. padding: 4px 0;
  19. margin: 0;
  20. text-align: center; /*set value to "left", "center", or "right"*/
  21. }
  22.  
  23. .chromestyle ul li{
  24. display:inline;
  25. }
  26.  
  27.  
  28. .chromestyle ul li a{
  29. color: #494949;
  30. padding: 4px 7px;
  31. margin: 0;
  32. text-decoration: none;
  33. border-right: 1px solid #DADADA;
  34. }
  35. .dropmenudiv{
  36. position:absolute;
  37. top: 0;
  38. border: 1px solid #BBB; /*THEME CHANGE HERE*/
  39. border-bottom-width: 0;
  40. font:normal 12px Verdana;
  41. line-height:18px;
  42. z-index:100;
  43. background-color: white;
  44. width: 200px;
  45. visibility: visible;
  46. }
  47. .dropmenudiv a{
  48. width: auto;
  49. display: block;
  50. text-indent: 3px;
  51. border-bottom: 1px solid #BBB; 
  52. padding: 2px 0;
  53. text-decoration: none;
  54. font-weight: bold;
  55. color: black;
  56. }
  57.  
Aug 19 '13 #5
Rabbit
12,516 Expert Mod 8TB
The triggering event's triggering element means exactly that. When an event is triggered, there's an element associated with that event. For example, if you click on a div, the triggering event is the click, the triggering element is the div.

I'm assuming you didn't write the code that you posted. Your best bet is to read the documentation on that library that you downloaded.
Aug 19 '13 #6
azegurb
32
The original code is above which i posted. but second code i myself wrote. if possible pls test it. it works but when i quickly move coursor on and out it crashes. for ex-if i mouseover Gallery and then Partners menus. one is closed and the another is opened. when i do several times, Partners dont open. so it crashes. Thank you for attention
Aug 19 '13 #7
Rabbit
12,516 Expert Mod 8TB
Compare the two HTML files. There are a lot of differences. For example, the HTML doctype being used is different. Yours is missing references to CSS files and JS files that are in the working version. And there is javascript code in the working version that is missing in yours.

Those are the 3 biggest mistakes I saw, there are probably others. You need to go through and compare line by line and fix the differences between the two files.
Aug 19 '13 #8

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

Similar topics

5
by: michael | last post by:
How may the following script be modified to function with the list structure below it? In short: it is meant to apply a background style to groups of LI's and ULs depeding on the URL filename. ...
1
by: Mosher | last post by:
Hi all, I am looking for some event handler auto-calc help on a form that takes user input through text fields and dropdown menus. I would like some of the text fields to be auto populated when...
4
by: Tim | last post by:
Hi, I've been searching the web for hours now and found lots and lots of javascript files with which you can create dropdown menu's, but with all of them you have to specify the width of the...
0
by: Phl | last post by:
hi, does any know why my javascript dropdownlist in my user control will only appear if I have my code as follows: // create an instance of the user control Control UCAdminDDMenu =...
2
by: Ian Davies | last post by:
Hello Ive been informed that I need to do the following in javascript. I have two drop down menus in my php script. The items displayed in the second is dependent on which item is choosen from the...
8
by: shrik | last post by:
I have one main page which contains two iframes say 'leftpanel' and 'content'. leftpanel contain page which has tree in it. Now whenever i clikc on the partiucular node the pages in the 'content'...
0
by: plunder | last post by:
Hi all what I'm trying to do is a flash menu which in some points has a dropdown sub-menu which comes out on mouseover and contains elements which if clicked link to other pages. Point is that these...
0
by: temp304 | last post by:
Customize Dropdown Menu is designed to display some choices, as: languages, countries, themes,... but it's differrent from original version in browsers. This tool combine CSS and JavaScript to create...
3
by: jerrydigital | last post by:
good evening, I am trying to allow my users to enter in text if they don't find their option on my drop down menu. In the code below, I can get a text box to show up when I select 'Other' on the...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.