friedice Posted September 29, 2012 Share Posted September 29, 2012 im tryin to create a navbar similar to the one on here well mostly other websites too when u log on on the site for example when u click on the username a popdown windows shows up i got the the div to show up including user information/ only problem is that the top part in the navbar doesnt change proper here its black background.. when u hover its grey background .. when u click it, it turns white i tried using just normal onmouseover and on mouseout and using image changes for it but when its mouse over it goes back to default black image <div id="header"> <a id="accountgear" href="javascript:toggle()"><img src="images/navigation/gear_icon_white_40x40.png" onmouseover="this.style.backgroundColor='#444444'" onmouseout="this.style.backgroundColor=''"/></a> </div> when clicked it calls the js to the show the div containin the info function toggle() { var ele = document.getElementById("accountgear"); var text = document.getElementById("accountsettings"); document.getElementById("accountsettings").style.display = "block"; $('#header').css({ 'opacity': 1 }); $('#accountsettings').css({ 'opacity': 1 }); $('#scroller').css({ 'opacity': 0.5 }); $('#maincontent').css({ 'opacity': 0.5 }); } function monitorClick(e){ var evt = (e)?e:event; var theElem = (evt.srcElement)?evt.srcElement:evt.target; while(theElem!=null){ if(theElem.id == "accountsettings" || theElem.id == "clickclick" && document.getElementById('accountsettings').style.display == 'none') { document.getElementById('accountsettings').style.display = 'block'; return true; } theElem = theElem.offsetParent; } document.getElementById('accountsettings').style.display = 'none'; $('#scroller').css({ 'opacity': 1}); return true; } document.onclick = monitorClick; accountsettings div is in the next div after the header thanks Quote Link to comment Share on other sites More sharing options...
friedice Posted October 2, 2012 Author Share Posted October 2, 2012 anyone? or a clue on goin bout this? Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted October 3, 2012 Share Posted October 3, 2012 anyone? or a clue on goin bout this? You haven't identified a problem. There are several approaches to this sort of thing, so instead of waiting for somebody to rewrite or copy and test your code, why don't you suggest where we can help you. (And this time, please use punctuation properly so we can understand.) Quote Link to comment Share on other sites More sharing options...
friedice Posted October 3, 2012 Author Share Posted October 3, 2012 Don't worry about it... I managed to fixed my code of doing it.. just changed my java-script abit.. and sorry about my punctuation Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.