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.
- var menuids=["sidebarmenu1"]
- function initsidebarmenu(){
- for (var i=0; i<menuids.length; i++){
- var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
- for (var t=0; t<ultags.length; t++){
- ultags[t].parentNode.getElementsByTagName("a")[0].className+=" subfolderstyle"
- if (ultags[t].parentNode.parentNode.id==menuids[i]) //if this is a first level submenu
- ultags[t].style.left=ultags[t].parentNode.offsetWidth+"px" //dynamically position first level submenus to be width of main menu item
- else //else if this is a sub level submenu (ul)
- ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
- ultags[t].parentNode.onmouseover=function(){
- this.getElementsByTagName("ul")[0].style.display="block"
- }
- ultags[t].parentNode.onmouseout=function(){
- this.getElementsByTagName("ul")[0].style.display="none"
- }
- }
- 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
- ultags[t].style.visibility="visible"
- ultags[t].style.display="none"
- }
- }
- }
- if (window.addEventListener)
- window.addEventListener("load", initsidebarmenu, false)
- else if (window.attachEvent)
- window.attachEvent("onload", initsidebarmenu)
- var marqueecontent='<nobr><font face="Arial" font-weight="bold" font-style="normal" font-size="14px" color="white"><b> SANTA MONICA / CULVER CITY / BEVERLY HILLS / WEST HOLLYWOOD / LOS ANGELES / BEL AIR / HOLLYWOOD / LOS FELIZ / MARINA DEL REY / BRENTWOOD / PACIFIC PALISADES / WESTWOOD / SILVERLAKE / VENICE / WEST LOS ANGELES /</b></font></nobr>'
- ////NO NEED TO EDIT BELOW THIS LINE////////////
- 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, cross_marquee2, ns_marquee
- function populate(){
- if (iedom){
- var initFill=(full==1)? '8px' : parseInt(marqueewidth)+8+"px"
- actualwidth=document.all? temp.offsetWidth : document.getElementById("temp").offsetWidth
- cross_marquee=document.getElementById? document.getElementById("iemarquee") : document.all.iemarquee
- cross_marquee.style.left=initFill
- cross_marquee2=document.getElementById? document.getElementById("iemarquee2") : document.all.iemarquee2
- cross_marquee2.innerHTML=cross_marquee.innerHTML=marqueecontent
- cross_marquee2.style.left=(parseInt(cross_marquee.style.left)+actualwidth+8)+"px" //indicates following #1
- }
- 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
- }
- setTimeout('lefttime=setInterval("scrollmarquee()",30)',initPause)
- }
- window.onload=populate
- function scrollmarquee(){
- if (iedom){
- if (parseInt(cross_marquee.style.left)<(actualwidth*(-1)+8))
- cross_marquee.style.left=(parseInt(cross_marquee2.style.left)+actualwidth+8)+"px"
- if (parseInt(cross_marquee2.style.left)<(actualwidth*(-1)+8))
- cross_marquee2.style.left=(parseInt(cross_marquee.style.left)+actualwidth+8)+"px"
- cross_marquee2.style.left=parseInt(cross_marquee2.style.left)-copyspeed+"px"
- cross_marquee.style.left=parseInt(cross_marquee.style.left)-copyspeed+"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 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:3px;display:inline;"></div>')
- write('<div id="iemarquee2" style="position:absolute;left:0px;top:3px;display:inline;"></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=3 onMouseover="copyspeed=pausespeed" onMouseout="copyspeed=marqueespeed"></layer>')
- write('</ilayer>')
- }
- document.write('</td></table>')
- }
- }