Monday 15 June 2015

slidingmenu - Javascript sliding menus not working -


This JavaScript sliding menu is not working - The only error the debugger gives is that the first IF statement is the block command; Curly braces, which I can not understand.

Is anyone seeing a clear error? I'm not sure that I'm using the 'this' keyword correctly (as well as the variable slide list inside the function show slideshow ... please give me any feedback on my support and my formatting (white space) Is appreciated!

  window.onload = makeMenus; var current slide = ft; var timid = null; var leftPos = 0; function makecan () {var slideMenus = new Array (); Var allElems = document.getElementsByTagName ("*" (Var i = 0; i & lt; allElems.length; i ++) {if (All Elemes [i] .className == "Slide Manage") menus.p (Var i = 0; i & lt; slideMenus.length; i ++) {slideMenus [i] .click = showSlide; slide management [i] .l.style.left for ush (allElems [i]);} = "0px"; // Slide Menness Array for each object, within that Ref 1 UL element, the object and the value of the UL elements are left for the document 0px} DocumentEgetmentById ("head"). Onclick = closeSlide; document .getElementById ("main"). Onclick = closeSlide;} showSlide () {var slideList = This.id + ".ul [0]"; // Store Object referee nested within the current object for 1 UL element (current slide! == faucet) {closeSlide (); } Else {closeSlide (); CurrentSlide = slideList; CurrentSlide.style.display = "block"; TimeID = setInterval ("moveSlide ()", 1); }} CloseSlide function (if {currentSlide! == null} {clearInterval (timeID); CurrentSlide.style.left = "0px"; CurrentSlide.style.display = "none"; CurrentSlide = Faucet; }} Slide slides (function) (if ((left pOS +5) & lt; = 220) {currentSlide.style.left = leftPos + "px"} and {clear interval (timeID); LeftPos = 0;}}    

Just having a look at your code, I've found that you have this line

var slideList = this.id + ".ul [0]"; // stores object referee 1 UL estrated nested

It seems that you have UL array Trying to catch the first element, but ever since you put it in your browser quotes It is likely that instead of treating it as a string, say this instead. If the string was equal to "ul-element", instead of getting the element in the variable ul [0], "ul-element. ] ".

Just out of curiosity, are you trying to use jquery to do your site? It will save a lot of time and headaches, though, I am doing this for the project so I Understand :)

- Frank

No comments:

Post a Comment