Thursday, April 17, 2014

angularjs page slider

Needed a sliding panel like the ones in Ipad for cascading dropdown. I wanted a button to open the dropdown panel and the panel to close after the last dropdown finished.

I used the nice directive provided by

Daniele Piccone in ng-pageslide

I have given below some code snippets to achieve this using the ng-pageslide directive.

<a  class="btn btn-primary"  ng-click="drop_down_open=true">Open</a>

<pageslide ps-open="drop_down_open" pageslide="left" ps-size="550px" ps-speed="0.5" ps-target="#div_dropdown"></pageslide>

<div id="div_dropdown">

<a ng-click="drop_down_open=false" class="btn btn-primary" >Close</a>
<div data-ng-include data-src="'pages/dropdown.html'">
</div>



In the controller to close or open



$scope.drop_down_open=false;

$scope.drop_down_open=true;

3 comments:

  1. Hi friend I read this blog and it's a very useful one because it have lots of information about the title, so I say a big thank to give this blog and I give this information, Creative Web Systems is a San Francisco based web design, web development company focusing on custom website development.
    webdesign sanfrancisco

    ReplyDelete
  2. Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!!.E Commerce San Francisco

    ReplyDelete