Jquery Issue with other Javascript in page

Jquery Issue with other Javascript in page

Hello,

I am a relatively new Jquery user and more of a PHP developer in general. I am currently doing both for a project and having some issues with a Jquery image slider and the other Javascript I'm using in the page.

The basic page contains two main scripts: a vertical Mainmenu and a scrolling Marquee across the bottom of the header. These have been working fine but I just tried to insert a cool Jquery slider called the Nivo Slider which uses jquery-1.4.3.min.js and also its own jquery.nivo.slider.pack.js

Problem is this slider is affecting the font in my marquee and cutting the menu off altogether.

I'm posting the two page scripts here below. If someone can point me in the right direction on how to fix this I would really appreciate it. I see sliders in pages with other javascript all the time. It's just an issue I haven't encountered before while developing.


  1. var menuids=["sidebarmenu1"]
  2. function initsidebarmenu(){
  3. for (var i=0; i<menuids.length; i++){
  4.   var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
  5.     for (var t=0; t<ultags.length; t++){
  6.     ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
  7.   if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
  8.    ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
  9.   else //else if this is a sub level submenu (ul)
  10.     ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
  11.     ultags[t].parentNode.onmouseover=function(){
  12.     this.getElementsByTagName("ul")[0].style.display="block"
  13.     }
  14.     ultags[t].parentNode.onmouseout=function(){
  15.     this.getElementsByTagName("ul")[0].style.display="none"
  16.     }
  17.     }
  18.   for (var t=ultags.length-1; t>-1; t--){ //loop through all sub menus again, and use "display:none" to hide menus (to prevent possible page scrollbars
  19.   ultags[t].style.visibility="visible"
  20.   ultags[t].style.display="none"
  21.   }
  22.   }
  23. }
  24. if (window.addEventListener)
  25. window.addEventListener("load", initsidebarmenu, false)
  26. else if (window.attachEvent)
  27. window.attachEvent("onload", initsidebarmenu)

  1. var marqueecontent='<nobr><font face="Arial" font-weight="bold" font-style="normal" font-size="14px" color="white"><b>&nbsp;SANTA MONICA&nbsp; / &nbsp;CULVER CITY&nbsp; / &nbsp;BEVERLY HILLS&nbsp; / &nbsp;WEST HOLLYWOOD&nbsp; /  &nbsp;LOS ANGELES&nbsp; / &nbsp;BEL AIR&nbsp; / &nbsp;HOLLYWOOD&nbsp; / &nbsp;LOS FELIZ&nbsp; / &nbsp;MARINA DEL REY&nbsp; / &nbsp;BRENTWOOD&nbsp; / &nbsp;PACIFIC PALISADES&nbsp; / &nbsp;WESTWOOD&nbsp; / &nbsp;SILVERLAKE&nbsp; / &nbsp;VENICE&nbsp; / &nbsp;WEST LOS ANGELES&nbsp; /</b></font></nobr>'
  2. ////NO NEED TO EDIT BELOW THIS LINE////////////
  3. var copyspeed=marqueespeed
  4. var pausespeed=(pauseit==0)? copyspeed: 0
  5. var iedom=document.all||document.getElementById
  6. if (iedom)
  7. document.write('<span id="temp" style="visibility:hidden;position:absolute;top:-100px;left:-9000px">'+marqueecontent+'</span>')
  8. var actualwidth=''
  9. var cross_marquee, cross_marquee2, ns_marquee
  10. function populate(){
  11. if (iedom){
  12. var initFill=(full==1)? '8px' : parseInt(marqueewidth)+8+"px"
  13. actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
  14. cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
  15. cross_marquee.style.left=initFill
  16. cross_marquee2=document.getElementById? document.getElementById("iemarquee2") : document.all.iemarquee2
  17. cross_marquee2.innerHTML=cross_marquee.innerHTML=marqueecontent
  18. cross_marquee2.style.left=(parseInt(cross_marquee.style.left)+actualwidth+8)+"px" //indicates following #1
  19. }
  20. else if (document.layers){
  21. ns_marquee=document.ns_marquee.document.ns_marquee2
  22. ns_marquee.left=parseInt(marqueewidth)+8
  23. ns_marquee.document.write(marqueecontent)
  24. ns_marquee.document.close()
  25. actualwidth=ns_marquee.document.width
  26. }
  27. setTimeout('lefttime=setInterval("scrollmarquee()",30)',initPause)
  28. }
  29. window.onload=populate
  30. function scrollmarquee(){
  31. if (iedom){
  32. if (parseInt(cross_marquee.style.left)<(actualwidth*(-1)+8))
  33. cross_marquee.style.left=(parseInt(cross_marquee2.style.left)+actualwidth+8)+"px"
  34. if (parseInt(cross_marquee2.style.left)<(actualwidth*(-1)+8))
  35. cross_marquee2.style.left=(parseInt(cross_marquee.style.left)+actualwidth+8)+"px"
  36. cross_marquee2.style.left=parseInt(cross_marquee2.style.left)-copyspeed+"px"
  37. cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"px"
  38. }
  39. else if (document.layers){
  40. if (ns_marquee.left>(actualwidth*(-1)+8))
  41. ns_marquee.left-=copyspeed
  42. else
  43. ns_marquee.left=parseInt(marqueewidth)+8
  44. }
  45. }
  46. if (iedom||document.layers){
  47. with (document){
  48. document.write('<table border="0" cellspacing="0" cellpadding="0"><td>')
  49. if (iedom){
  50. write('<div style="position:relative;width:'+marqueewidth+';height:'+marqueeheight+';overflow:hidden">')
  51. write('<div style="position:absolute;width:'+marqueewidth+';height:'+marqueeheight+';background-color:'+marqueebgcolor+'" onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed">')
  52. write('<div id="iemarquee" style="position:absolute;left:0px;top:3px;display:inline;"></div>')
  53. write('<div id="iemarquee2" style="position:absolute;left:0px;top:3px;display:inline;"></div>')
  54. write('</div></div>')
  55. }
  56. else if (document.layers){
  57. write('<ilayer width='+marqueewidth+' height='+marqueeheight+' name="ns_marquee" bgColor='+marqueebgcolor+'>')
  58. write('<layer name="ns_marquee2" left=0 top=3 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
  59. write('</ilayer>')
  60. }
  61. document.write('</td></table>')
  62. }
  63. }