问题
Can you please tell me how we slide div when user click tab .I make demo in jQuery Mobile (fiddle http://jsfiddle.net/ezanker/o9foej5L/1/ ) in which I have three tab and using the tab it show transition can you please tell me how we can do same in angular ? I am trying to achieve this but I am not able to do that how I ail achieve this in angular?
Plunker http://plnkr.co/edit/ornYCV15uV8lPNL1ujPL?p=preview
$(function(){
$("#owl-demo").owlCarousel({
navigation : false, // Show next and prev buttons
pagination : false, //hide pagination dots
slideSpeed : 300,
paginationSpeed : 400,
singleItem:true,
afterMove: function(){
var owl = $("#owl-demo").data('owlCarousel');
$(".tabBtn").removeClass("ui-btn-active").eq(owl.currentItem).addClass("ui-btn-active");
}
});
})
回答1:
After a long RND .I am able to solve that problem own .I make a directive like that than using that directive I animate the div Here is demo http://plnkr.co/edit/M08sP4oEZLWr6HgGKAde?p=preview
app.directive('owlCarousel', function() {
return {
restrict: 'A',
scope: {
owlOption: '='
},
link: function(scope, element, attrs) {
$(element).owlCarousel(scope.owlOption);
}
};
});
来源:https://stackoverflow.com/questions/25669892/animation-in-angular-js-slide-animation-of-div