Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/268907-navbar-similar-to-this-one/
Share on other sites

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.)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.