Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the switching effect of Tab column by angularjs

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "angularjs how to achieve Tab column switching effect", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "angularjs how to achieve Tab column switching effect" bar!

As shown in the figure

The instance code submitted after selection:

. div-img {float: left; margin:5px;} img {width:200px; height:200px; border:2px solid pink;} .kongxin {margin:0 auto; background-color: # ddd Width:20px; height:20px; border-radius: 10px;} .shixin {margin:0 auto; background-color: red; width:20px; height:20px; border-radius: 10px }. Pic-title {text-align: center;}

显示图片

Var myApp=angular.module ('myApp', []) MyApp.controller ("myController", ['$scope',function ($scope) {$scope.picLists= [{picName: "Picture 1", url:'imgs/img1.jpg', title:' Picture title 1'}, {picName: "Picture 2" Url:'imgs/img2.jpg', title:' picture title 2'}, {picName: "Picture 3", url:'imgs/img3.jpg', title:' picture title 3'} {picName: "Picture 4", url:'imgs/img4.jpg', title:' Picture title 4'}, {picName: "Picture 5", url:'imgs/img5.jpg' Title:' picture title 5'}] angular.forEach ($scope.picLists,function (item) {item.selected=true }) $scope.checkItems=function (picItem) {angular.forEach ($scope.picLists,function (item) {if (item.title==picItem.title) {item.checked=true; item.selected=false;} else {item.checked=false; item.selected=true) }})}; $scope.choosePic=function () {angular.forEach ($scope.picLists,function (item) {if (item.checked) {$scope.url=item.url) }})}) Thank you for your reading. The above is the content of "how to achieve Tab column switching effect in angularjs". After the study of this article, I believe you have a deeper understanding of how angularjs can achieve Tab column switching effect, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report