Showing posts with label jquery. Show all posts
Showing posts with label jquery. Show all posts

Friday, June 15, 2012

Implement tab side out

Hello Guys,
      To implement tab slide out along with you application use the below code.


Download 2 javascript files:
1. jquery.min.js
2. tabSlideOut.v1.3.js


In your html page simply add below code.


<html>
  <head>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
    <script src="http://www.building58.com/examples/js/jquery.tabSlideOut.v1.3.js"></script>
  </head>
 
  <body>
    <script type="text/javascript">
      $(function(){
       jQuery('.slide-out-div').tabSlideOut({
 
         tabHandle: '.handle', //class of the element that will become your tab
         pathToTabImage: 'http://www.building58.com/examples/images/contact_tab.gif',
         //path to the image for the tab //Optionally can be set using css
         imageHeight: '190px', //height of tab image           //Optionally can be set using css
         imageWidth: '59px', //width of tab image            //Optionally can be set using css
         tabLocation: 'left', //side of screen where tab lives, top, right, bottom, or left
         speed: 300, //speed of animation
         action: 'click', //options: 'click' or 'hover', action to trigger animation
         topPos: '100px', //position from the top/ use if tabLocation is left or right
         leftPos: '20px', //position from left/ use if tabLocation is bottom or top
         fixedPosition: false //options: true makes it stick(fixed position) on scroll
       });
 
      });

     jQuery.noConflict(); // use this when prototype will be conflict with jquery.
 
    </script>

    <style type="text/css">
     
      .slide-out-div {
          padding: 20px;
          width: 250px;
          background: #ccc;
          border: 1px solid #29216d;
      }
    </style>

    <div class="slide-out-div">
      <a class="handle" href="javascript:;">Content</a>
      <h3>Contact Us</h3>
      <p>
        Click on here to contact us..blah..blah..
      </p>
    </div>
  </body>

</html>