CaptainXD
CaptainXD

Reputation: 83

Slidepanel jquery menu

I've been having a problem utilizing a jquery plugin called SlidePanel. It's a slide-out menu that looks awesome, but I can't get it to work. The instructions seem a bit sparse, and I'm not sure if I did it wrong, or it's just not working.

SlidePanel - http://codebomber.com/jquery/slidepanel/

<!DOCTYPE HTML>
<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>iON | Home</title>
      <link rel="stylesheet" type="text/css" href="/css/web.css" />
      <link rel="stylesheet" type="text/css" href="/css/fonts.css" />
      <link rel="stylesheet" type="text/css" href="/css/jquery.slidepanel.css">
      <script type="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
      <script type="text/javascript" src="/js/jquery.slidepanel.js"></script>


   </head>
<body>
   <nav>
      <ul>
         <li><a id="title" href="index.php">iON»</a></li>
         <li style="float: right;"><a id="menu" href="#"><img src="/images/menu.png" height="20" width="20" /></a>
            <ul>
               <li><a href="profile.php">Profile</a></li>
               <li><a href="login.php">Login</a></li>
            </ul>
         </li>
      </ul>
   </nav>

<div class="content">
<a href="index.php" data-slidepanel="panel">Show Panel</a>
</div>

<script type="text/javascript">
      $(document).ready(function(){
          $('[data-slidepanel]').slidepanel({
              orientation: 'top',
              mode: 'push'
          });
      });
</script>

</body>
</html>

Upvotes: 1

Views: 1134

Answers (1)

Nix
Nix

Reputation: 58522

Your selector is bad. Just add a class and make it simpliler.

<a href="index.php" class='slidepanel' data-slidepanel="panel">Show Panel</a>


$(".slidepanel").slidepanel({
    orientation: 'top',
    mode: 'push'
});

Or

$("[data-slidepanel='panel']").slidepanel({
    orientation: 'top',
    mode: 'push'
});

Working fiddle: http://jsfiddle.net/ncapito/8TEjx/

Upvotes: 1

Related Questions