Recent Posts
SeC Gaming
the Lounge
New Lounge Topic
New Gaming Topic
We've moved to Discord

You are not connected. Please login or register

the top menu,

2 posters

Go down  Message [Page 1 of 1]

1the top menu, Empty the top menu, 2011-12-27, 11:04

Admin

Admin

i plan on stylizing it, but atm im worried about its functions.

the menu is supposed to be solid while your at the top of the page.
semi-transparent when you're scrolling
and solid on hover.

so far it works on every aspect except when you scroll back up.

these are my codes..who sees my problem?

HTML and Internal/external JS
Code:
<div id="nav">
 
  <table cellspacing="0" cellpadding="0" border="0" align="{MENU_POSITION}">
               <tr>
                  <td align="{MENU_POSITION}"{MENU_NOWRAP}>{GENERATED_NAV_BAR}</td>
               </tr>
            </table>
 
  <script type="text/javascript" src="jquery-1.3.2.js"></script>
        <script type="text/javascript">
            $(function() {
                $(window).scroll(function(){
               var scrollTop = $(window).scrollTop();
               if(scrollTop != 0)
                  $('#nav').stop().animate({'opacity':'0.2'},400);
               else   
                  $('#nav').stop().animate({'opacity':'1'},400);
            });
            
            $('#nav').hover(
               function (e) {
                  var scrollTop = $(window).scrollTop();
                  if(scrollTop != 0){
                     $('#nav').stop().animate({'opacity':'1'},400);
                  }
               },
               function (e) {
                  var scrollTop = $(window).scrollTop();
                  if(scrollTop != 0){
                     $('#nav').stop().animate({'opacity':'0.2'},400);
                  }
               }
            );
            });
        </script>
  </div>

CSS3
Code:
#nav {
  Background-image:url("http://i46.servimg.com/u/f46/15/56/73/55/menu11.png") repeat;
  position: fixed;
  height: 40px;
  width: 1000px;
  top:0px;
  left:0px;
  z-index: 999;

}

http://www.speakeasyclinic.com

2the top menu, Empty Re: the top menu, 2011-12-27, 11:18

Chewy

Chewy

Where is this code at?

I could try debugging it for a bit.

3the top menu, Empty Re: the top menu, 2011-12-27, 11:25

Admin

Admin

i took it down for now. and only the admin account can get into the html templates.

http://www.speakeasyclinic.com

4the top menu, Empty Re: the top menu, 2011-12-27, 11:26

Admin

Admin

ill prob just go with a slide-out approach.

http://www.speakeasyclinic.com

5the top menu, Empty Re: the top menu, 2011-12-27, 11:31

Chewy

Chewy

Admin wrote:i took it down for now. and only the admin account can get into the html templates.
Aw that's lame.

The only thing I could see that could be wrong with it is that the top function only runs when you first start scrolling but doesn't run again after that. Or maybe it thinks that there is a pixel or two of scrolling left at the top.

I normally throw some alerts around the variables in functions that aren't working properly in order to debug. But that's kind of annoying for the people at the site...

Sponsored content



Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum