Pages

Monday 27 May 2013

How To Make jQuery Floating Navigation Menu Scrolling OR jQuery Move Menu with Scroll of Web Page in Html And c# Asp.Net

How To Make jQuery Floating Navigation Menu Scrolling OR jQuery Move Menu with Scroll of Web Page in Html And c# Asp.Net


Program:

.Aspx File


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Demo - Creating a Floating Navigation Menu</title>

  <!-- Include jQuery -->
  <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script>

  <style type='text/css'>

   body {
   background-color: #FFF;
   <!--color: Black;-->
   font: 12px/1.4em Arial,sans-serif;
}
#wrap {
   margin: 10px auto;    
   background: #666;
   padding: 10px;
   width: 700px;
}
#header {
   background-color: #666;
   color: #FFF;
}
#logo {
   font-size: 30px;
   line-height: 40px;
   padding: 5px;
}
#navWrap {
   height: 30px;
}
#nav {
   padding: 5px;
   background: #999;
}
#nav ul {
   margin: 0;
   padding: 0;
}
#nav li {
   float: left;
   padding: 3px 8px;
   background-color: #B52025;
   margin: 0 10px 0 0;
   color: #FFF;
   list-style-type: none;
}
#nav li a {
   color: #FFF;
   text-decoration: none;
}
#nav li a:hover {
   text-decoration: underline;
}
br.clearLeft {
   clear: left;    
}​
  </style>

<script type='text/javascript'>
    //<![CDATA[

    $(function () {
        // Stick the #nav to the top of the window
        var nav = $('#nav');
        var navHomeY = nav.offset().top;
        var isFixed = false;
        var $w = $(window);
        $w.scroll(function () {
            var scrollTop = $w.scrollTop();
            var shouldBeFixed = scrollTop > navHomeY;
            if (shouldBeFixed && !isFixed) {
                nav.css({
                    position: 'fixed',
                    top: 0,
                    left: nav.offset().left,
                    width: nav.width()
                });
                isFixed = true;
            }
            else if (!shouldBeFixed && isFixed) {
                nav.css({
                    position: 'static'
                });
                isFixed = false;
            }
        });
    });

    //]]>
</script>

</head>
<body>
<form id="form1" runat="server">
<div id="wrap">
 
    <!-- The header code, including the menu -->
    <div id="header">
        <div id="logo">Start Slowly Scrolling Down<br /> This Page!</div>
        <div id="navWrap">
            <div id="nav">
                <ul>
                    <li><a href="#" class="smoothScroll">Demo Link 1</a></li>
                    <li><a href="#" class="smoothScroll">Demo Link 2</a></li>
                    <li><a href="#" class="smoothScroll">Demo Link 3</a></li>
                    <li><a href="#" class="smoothScroll">Demo Link 4</a></li>
                </ul>
                <br class="clearLeft" />
            </div>
        </div>
    </div>
 
    <!-- The main page content (just filler for this demo) -->
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
       <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
       <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
  <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
       <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
  <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
       <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
  <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
  <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
       <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
   <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
    <p>
    http://fantasyaspnet.blogspot.in/ offers Asp.net,C#.net,SQL Server,Web Services,WCF,WPF,MVC,Crystal Reports,AJAX,XML,JavaScript,JQuery,Gridview articles, samples and tutorials,code examples of asp.net 2.0,3.0,3.5,4.0 and Articles,examples of .net technologies.
    </p>
</div>
   </form>
</body>
</html>

Demo:

for live demo check this site jQuery smooth scrolling floating Menu

No comments:

Post a Comment