



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

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
        <title>jquery.slide.js at edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed from vanntastic's jquery-slide - GitHub</title>
    <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="GitHub" />
    <link rel="fluid-icon" href="http://github.com/fluidicon.png" title="GitHub" />

    
      <link href="http://assets3.github.com/stylesheets/bundle.css?72251d256c54f285541069567ee1a269bbe08b3b" media="screen" rel="stylesheet" type="text/css" />
    

    
      
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
        <script src="http://assets1.github.com/javascripts/bundle.js?72251d256c54f285541069567ee1a269bbe08b3b" type="text/javascript"></script>
      
    
    
  
    
  

  <link href="http://github.com/feeds/vanntastic/commits/jquery-slide/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed" rel="alternate" title="Recent Commits to jquery-slide:edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed" type="application/atom+xml" />

    <meta name="description" content="Stop jumping anchor links and slide them instead" />


    

    <script type="text/javascript">
      github_user = null
    </script>
  </head>

  

  <body>
    

    <div id="main">
      <div id="header" class="">
        <div class="site">
          <div class="logo">
            <a href="http://github.com"><img src="/images/modules/header/logov3.png" alt="github" /></a>
          </div>
          
            <div class="topsearch">
  <form action="/search" id="top_search_form" method="get">
    <input type="search" class="search" name="q" /> <input type="submit" value="Search" />
    <input type="hidden" name="type" value="Everything" />
    <input type="hidden" name="repo" value="" />
    <input type="hidden" name="langOverride" value="" />
    <input type="hidden" name="start_value" value="1" />
  </form>
  <div class="links">
    <a href="/repositories">Browse</a> | <a href="/guides">Guides</a> | <a href="/search">Advanced</a>
  </div>
</div>
          
            
              <div class="actions">
                
                  <a href="http://github.com">Home</a>
                  <a href="/plans"><b><u>Pricing and Signup</u></b></a>
                  <a href="http://github.com/popular/forked">Repositories</a>
                  
                  <a href="/blog">Blog</a>
                
                <a href="https://github.com/login">Login</a>
              </div>
            
        </div>
      </div>

      
        
    <div id="repo_menu">
      <div class="site">
        <ul>
          
            <li class="active"><a href="http://github.com/vanntastic/jquery-slide/tree/">Source</a></li>

            <li class=""><a href="http://github.com/vanntastic/jquery-slide/commits/">Commits</a></li>

            
            <li class=""><a href="/vanntastic/jquery-slide/network">Network (1)</a></li>

            

            
              
              <li class=""><a href="/vanntastic/jquery-slide/issues">Issues (0)</a></li>
            

            
              
              <li class=""><a href="/vanntastic/jquery-slide/downloads">Downloads (0)</a></li>
            

            
              
              <li class=""><a href="http://wiki.github.com/vanntastic/jquery-slide">Wiki (1)</a></li>
            

            <li class=""><a href="/vanntastic/jquery-slide/graphs">Graphs</a></li>

            

          
        </ul>
      </div>
    </div>

  <div id="repo_sub_menu">
    <div class="site">
      <div class="joiner"></div>
      

      

      

      
    </div>
  </div>

  <div class="site">
    





<div id="repos">
  


<script type="text/javascript">
  GitHub.currentCommitRef = "edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed"
  GitHub.currentRepoOwner = "vanntastic"
  GitHub.currentRepo = "jquery-slide"
  
</script>



  <div class="repo public" id="repo_details">
    <div class="title">
      <div class="path">
        <a href="/vanntastic">vanntastic</a> / <b><a href="http://github.com/vanntastic/jquery-slide/tree">jquery-slide</a></b>

        

          <span id="edit_button" style="display:none;">
            <a href="/vanntastic/jquery-slide/edit"><img alt="edit" class="button" src="http://assets2.github.com/images/modules/repos/edit_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
          </span>

          
            <span id="pull_request_button" style="display:none;">
              <a href="/vanntastic/jquery-slide/pull_request/" class="pull_request_button"><img alt="pull request" class="button" src="http://assets2.github.com/images/modules/repos/pull_request_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
            </span>
            
            <span id="fast_forward_button" style="display:none;">
              <a href="/vanntastic/jquery-slide/fast_forward" id="ff_button"><img alt="fast forward" class="button" src="http://assets1.github.com/images/modules/repos/fast_forward_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
            </span>

            <span id="fork_button">
              <a href="/vanntastic/jquery-slide/fork"><img alt="fork" class="button" src="http://assets2.github.com/images/modules/repos/fork_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
            </span>
          

          <span id="watch_button">
            <a href="/vanntastic/jquery-slide/toggle_watch" class="toggle_watch"><img alt="watch" class="button" src="http://assets2.github.com/images/modules/repos/watch_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
          </span>
          
          <span id="unwatch_button" style="display:none;">
            <a href="/vanntastic/jquery-slide/toggle_watch" class="toggle_watch"><img alt="watch" class="button" src="http://assets1.github.com/images/modules/repos/unwatch_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
          </span>

          
            <a href="#" id="download_button" rel="vanntastic/jquery-slide"><img alt="download tarball" class="button" src="http://assets0.github.com/images/modules/repos/download_button.png?72251d256c54f285541069567ee1a269bbe08b3b" /></a>
          
        
      </div>

      <div class="security private_security" style="display:none">
        <a href="#private_repo" rel="facebox"><img src="/images/icons/private.png" alt="private" /></a>
      </div>

      <div id="private_repo" class="hidden">
        This repository is private.
        All pages are served over SSL and all pushing and pulling is done over SSH.
        No one may fork, clone, or view it unless they are added as a <a href="/vanntastic/jquery-slide/edit">member</a>.

        <br/>
        <br/>
        Every repository with this icon (<img src="/images/icons/private.png" alt="private" />) is private.
      </div>

      <div class="security public_security" style="">
        <a href="#public_repo" rel="facebox"><img src="/images/icons/public.png" alt="public" /></a>
      </div>

      <div id="public_repo" class="hidden">
        This repository is public.
        Anyone may fork, clone, or view it.

        <br/>
        <br/>
        Every repository with this icon (<img src="/images/icons/public.png" alt="public" />) is public.
      </div>

      

        <div class="flexipill">
          <a href="/vanntastic/jquery-slide/network">
          <table cellpadding="0" cellspacing="0">
            <tr><td><img alt="Forks" src="http://assets3.github.com/images/modules/repos/pills/forks.png?72251d256c54f285541069567ee1a269bbe08b3b" /></td><td class="middle"><span>1</span></td><td><img alt="Right" src="http://assets3.github.com/images/modules/repos/pills/right.png?72251d256c54f285541069567ee1a269bbe08b3b" /></td></tr>
          </table>
          </a>
        </div>

        <div class="flexipill">
          <a href="/vanntastic/jquery-slide/watchers">
          <table cellpadding="0" cellspacing="0">
            <tr><td><img alt="Watchers" src="http://assets2.github.com/images/modules/repos/pills/watchers.png?72251d256c54f285541069567ee1a269bbe08b3b" /></td><td class="middle"><span>1</span></td><td><img alt="Right" src="http://assets3.github.com/images/modules/repos/pills/right.png?72251d256c54f285541069567ee1a269bbe08b3b" /></td></tr>
          </table>
          </a>
        </div>
      </div>

    <div class="meta">
      <table>
        
        <tr>
          <td class="label">Description:</td>
          <td>
            <span id="repository_description" rel="/vanntastic/jquery-slide/edit/update">Stop jumping anchor links and slide them instead</span>
            <a href="#description" class="edit_link action" style="display:none;">edit</a>
          </td>
        </tr>

        
            <tr>
              <td class="label">Homepage:</td>
              <td>
                                
                <span id="repository_homepage" rel="/vanntastic/jquery-slide/edit/update">
                  <a href="http://"></a>
                </span>
                <a href="#homepage" class="edit_link action" style="display:none;">edit</a>
              </td>
            </tr>

          
            <tr>
              <td class="label"><span id="public_clone_text" style="display:none;">Public&nbsp;</span>Clone&nbsp;URL:</td>
              
              <td>
                <a href="git://github.com/vanntastic/jquery-slide.git" class="git_url_facebox" rel="#git-clone">git://github.com/vanntastic/jquery-slide.git</a>
                      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
              width="110"
              height="14"
              class="clippy"
              id="clippy" >
      <param name="movie" value="/flash/clippy.swf"/>
      <param name="allowScriptAccess" value="always" />
      <param name="quality" value="high" />
      <param name="scale" value="noscale" />
      <param NAME="FlashVars" value="text=git://github.com/vanntastic/jquery-slide.git">
      <param name="bgcolor" value="#F0F0F0">
      <param name="wmode" value="opaque">
      <embed src="/flash/clippy.swf"
             width="110"
             height="14"
             name="clippy"
             quality="high"
             allowScriptAccess="always"
             type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"
             FlashVars="text=git://github.com/vanntastic/jquery-slide.git"
             bgcolor="#F0F0F0"
             wmode="opaque"
      />
      </object>

                <div id="git-clone" style="display:none;">
                  Give this clone URL to anyone.
                  <br/>
                  <code>git clone git://github.com/vanntastic/jquery-slide.git </code>
                </div>
              </td>
            </tr>
          
          
          <tr id="private_clone_url" style="display:none;">
            <td class="label">Your Clone URL:</td>
            
            <td>

              <div id="private-clone-url">
                <a href="git@github.com:vanntastic/jquery-slide.git" class="git_url_facebox" rel="#your-git-clone">git@github.com:vanntastic/jquery-slide.git</a>
                <input type="text" value="git@github.com:vanntastic/jquery-slide.git" style="display: none;" />
                      <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
              width="110"
              height="14"
              class="clippy"
              id="clippy" >
      <param name="movie" value="/flash/clippy.swf"/>
      <param name="allowScriptAccess" value="always" />
      <param name="quality" value="high" />
      <param name="scale" value="noscale" />
      <param NAME="FlashVars" value="text=git@github.com:vanntastic/jquery-slide.git">
      <param name="bgcolor" value="#F0F0F0">
      <param name="wmode" value="opaque">
      <embed src="/flash/clippy.swf"
             width="110"
             height="14"
             name="clippy"
             quality="high"
             allowScriptAccess="always"
             type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"
             FlashVars="text=git@github.com:vanntastic/jquery-slide.git"
             bgcolor="#F0F0F0"
             wmode="opaque"
      />
      </object>

              </div>

              <div id="your-git-clone" style="display:none;">
                Use this clone URL yourself.
                <br/>
                <code>git clone git@github.com:vanntastic/jquery-slide.git </code>
              </div>
            </td>
          </tr>
          
          

          

          
      </table>

          </div>
  </div>






</div>


  <div id="commit">
    <div class="group">
        
  <div class="envelope commit">
    <div class="human">
      
        <div class="message"><pre><a href="/vanntastic/jquery-slide/commit/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed">make sure valid links will return true</a> </pre></div>
      

      <div class="actor">
        <div class="gravatar">
          
          <img alt="" height="30" src="http://www.gravatar.com/avatar/47634268835e21bffb3dbdb5595311fa?s=30&amp;d=http%3A%2F%2Fgithub.com%2Fimages%2Fgravatars%2Fgravatar-30.png" width="30" />
        </div>
        <div class="name"><a href="/vanntastic">vanntastic</a> <span>(author)</span></div>
          <div class="date">
            <abbr class="relatize" title="2009-07-16 13:15:30">Thu Jul 16 13:15:30 -0700 2009</abbr> 
          </div>
      </div>
  
      
  
    </div>
    <div class="machine">
      <span>c</span>ommit&nbsp;&nbsp;<a href="/vanntastic/jquery-slide/commit/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed" hotkey="c">edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed</a><br />
      <span>t</span>ree&nbsp;&nbsp;&nbsp;&nbsp;<a href="/vanntastic/jquery-slide/tree/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed" hotkey="t">e5586b691af54f4423d2a9147b7953a23d5ce05e</a><br />
  
      
        <span>p</span>arent&nbsp;
        
        <a href="/vanntastic/jquery-slide/tree/2841fd8908dd97648dcf610d25191d681ff64ed9" hotkey="p">2841fd8908dd97648dcf610d25191d681ff64ed9</a>
      
  
    </div>
  </div>

    </div>
  </div>



  
    <div id="path">
      <b><a href="/vanntastic/jquery-slide/tree/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed">jquery-slide</a></b> / jquery.slide.js       <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
              width="110"
              height="14"
              class="clippy"
              id="clippy" >
      <param name="movie" value="/flash/clippy.swf"/>
      <param name="allowScriptAccess" value="always" />
      <param name="quality" value="high" />
      <param name="scale" value="noscale" />
      <param NAME="FlashVars" value="text=jquery.slide.js">
      <param name="bgcolor" value="#FFFFFF">
      <param name="wmode" value="opaque">
      <embed src="/flash/clippy.swf"
             width="110"
             height="14"
             name="clippy"
             quality="high"
             allowScriptAccess="always"
             type="application/x-shockwave-flash"
             pluginspage="http://www.macromedia.com/go/getflashplayer"
             FlashVars="text=jquery.slide.js"
             bgcolor="#FFFFFF"
             wmode="opaque"
      />
      </object>

    </div>

    <div id="files">
      <div class="file">
        <div class="meta">
          <div class="info">
            <span>100644</span>
            <span>26 lines (15 sloc)</span>
            <span>0.575 kb</span>
          </div>
          <div class="actions">
            
            <a href="/vanntastic/jquery-slide/raw/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed/jquery.slide.js" id="raw-url">raw</a>
            
              <a href="/vanntastic/jquery-slide/blame/edf9dfbfd28b1158f9acad07d7a531c1c95cb0ed/jquery.slide.js">blame</a>
            
            <a href="/vanntastic/jquery-slide/commits/master/jquery.slide.js">history</a>
          </div>
        </div>
        
  <div class="data syntax">
    
      <table cellpadding="0" cellspacing="0">
        <tr>
          <td>
            
            <pre class="line_numbers">
<span id="LID1" rel="#L1">1</span>
<span id="LID2" rel="#L2">2</span>
<span id="LID3" rel="#L3">3</span>
<span id="LID4" rel="#L4">4</span>
<span id="LID5" rel="#L5">5</span>
<span id="LID6" rel="#L6">6</span>
<span id="LID7" rel="#L7">7</span>
<span id="LID8" rel="#L8">8</span>
<span id="LID9" rel="#L9">9</span>
<span id="LID10" rel="#L10">10</span>
<span id="LID11" rel="#L11">11</span>
<span id="LID12" rel="#L12">12</span>
<span id="LID13" rel="#L13">13</span>
<span id="LID14" rel="#L14">14</span>
<span id="LID15" rel="#L15">15</span>
<span id="LID16" rel="#L16">16</span>
<span id="LID17" rel="#L17">17</span>
<span id="LID18" rel="#L18">18</span>
<span id="LID19" rel="#L19">19</span>
<span id="LID20" rel="#L20">20</span>
<span id="LID21" rel="#L21">21</span>
<span id="LID22" rel="#L22">22</span>
<span id="LID23" rel="#L23">23</span>
<span id="LID24" rel="#L24">24</span>
<span id="LID25" rel="#L25">25</span>
<span id="LID26" rel="#L26">26</span>
</pre>
          </td>
          <td width="100%">
            
            
              <div class="highlight"><pre><div class="line" id="LC1"><span class="c">/*******</span></div><div class="line" id="LC2">&nbsp;</div><div class="line" id="LC3"><span class="c">	Origin of code from :   http://www.position-absolute.com/articles/better-html-anchor-a-jquery-script-to-slide-the-scrollbar/</span></div><div class="line" id="LC4"><span class="c">	</span></div><div class="line" id="LC5"><span class="c">	USAGE : </span></div><div class="line" id="LC6"><span class="c">	</span></div><div class="line" id="LC7"><span class="c">  	$(&#39;a.slide&#39;).slide();</span></div><div class="line" id="LC8"><span class="c">	</span></div><div class="line" id="LC9"><span class="c">*****/</span></div><div class="line" id="LC10">&nbsp;</div><div class="line" id="LC11"><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">$</span><span class="p">)</span> <span class="p">{</span></div><div class="line" id="LC12">&nbsp;</div><div class="line" id="LC13">&nbsp;&nbsp;&nbsp;&nbsp;<span class="nx">$</span><span class="p">.</span><span class="nx">fn</span><span class="p">.</span><span class="nx">slide</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span></div><div class="line" id="LC14">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class="line" id="LC15">&nbsp;&nbsp;&nbsp;&nbsp;	<span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">click</span><span class="p">(</span><span class="kd">function</span> <span class="p">()</span> <span class="p">{</span>	</div><div class="line" id="LC16">&nbsp;&nbsp;			<span class="nx">elementClick</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nx">attr</span><span class="p">(</span><span class="s2">&quot;href&quot;</span><span class="p">);</span></div><div class="line" id="LC17">&nbsp;&nbsp;			<span class="nx">destination</span> <span class="o">=</span> <span class="nx">$</span><span class="p">(</span><span class="nx">elementClick</span><span class="p">).</span><span class="nx">offset</span><span class="p">().</span><span class="nx">top</span><span class="o">;</span></div><div class="line" id="LC18">&nbsp;&nbsp;			<span class="nx">$</span><span class="p">(</span><span class="s2">&quot;html:not(:animated),body:not(:animated)&quot;</span><span class="p">).</span><span class="nx">animate</span><span class="p">({</span> <span class="nx">scrollTop</span><span class="o">:</span> <span class="nx">destination</span><span class="p">}</span><span class="o">,</span> <span class="mi">1100</span> <span class="p">);</span></div><div class="line" id="LC19">&nbsp;&nbsp;			</div><div class="line" id="LC20">&nbsp;&nbsp;		  <span class="k">return</span> <span class="nx">elementClick</span><span class="p">.</span><span class="nx">charAt</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span> <span class="o">==</span> <span class="s2">&quot;#&quot;</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="kc">true</span><span class="o">;</span></div><div class="line" id="LC21">&nbsp;&nbsp;		<span class="p">})</span>           </div><div class="line" id="LC22">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class="line" id="LC23">&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class="line" id="LC24">&nbsp;&nbsp;&nbsp;&nbsp;</div><div class="line" id="LC25"><span class="p">})(</span><span class="nx">jQuery</span><span class="p">);</span></div><div class="line" id="LC26">&nbsp;</div></pre></div>
            
          </td>
        </tr>
      </table>
    
  </div>


      </div>
    </div>
    
  


  </div>

      

      <div class="push"></div>
    </div>

    <div id="footer">
      <div class="site">
        <div class="info">
          <div class="links">
            <a href="http://github.com/blog"><b>Blog</b></a> |
            <a href="http://support.github.com/">Support</a> |
            <a href="http://github.com/training">Training</a> |
            <a href="http://github.com/contact">Contact</a> |
            <a href="http://develop.github.com">API</a> |
            <a href="http://twitter.com/github">Status</a> |
            <a href="http://twitter.com/github">GitHub on Twitter</a> |
            <a href="http://github.com/guides/home">Help</a>

         </div>
          <div class="company">
            <span id="_rrt" title="0.72974s from xc88-s00039">GitHub</span>&trade;
            is <a href="http://logicalawesome.com/">Logical Awesome</a> &copy;2009 | <a href="/site/terms">Terms of Service</a> | <a href="/site/privacy">Privacy Policy</a>
          </div>
        </div>
        <div class="sponsor">
          <a href="http://engineyard.com"><img src="/images/modules/footer/ey-rubyhosting.png" alt="Engine Yard" /></a>
        </div>
      </div>
    </div>

    <div id="coming_soon" style="display:none;">
      This feature is coming soon.  Sit tight!
    </div>

    
        <script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    </script>
    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-3769691-2");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>

    
  </body>
</html>

