angular实现开关切换按钮点击效果代码

代码语言:html

所属分类:其他

代码描述:angular实现开关切换按钮点击效果代码

代码标签: angular 开关 切换 按钮 点击

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">


<link rel='stylesheet' href='//fonts.googleapis.com/icon?family=Material+Icons'>
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/angular-material.min.css">
<style>
    /*=====================================
=            SWITCH STYLES            =
======================================*/
body {
  background-color: #4085ee;
}
body > div {
  position: relative;
  width: 100%;
  height: 100%;
}

#page {
  position: relative;
  width: 100%;
  height: 100%;
  display: -webkit-flex;
  display: flex;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-align-items: center;
  align-items: center;
}

.switch input {
  display: none;
  visibility: hidden;
  opacity: 0;
}
.switch .s_wrapper {
  position: relative;
  background-color: #1e59af;
  width: 120px;
  height: 60px;
  -moz-border-radius: 40px;
  -webkit-border-radius: 40px;
  border-radius: 40px;
}
.switch .s_wrapper form {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  *zoom: 1;
  overflow: visible;
}
.switch .s_wrapper form label {
  width: 50%;
  height: 100%;
  float: left;
  text-align: center;
  display: flex;
  -webkit-justify-content: center;
  justify-content: center;
}
.switch .s_wrapper form label md-icon {
  z-index: 2;
  cursor: pointer;
  color: #4085ee;
}
.switch .s_wrapper .switch_bubble {
  position: absolute;
  height: 140%;
  width: auto;
  z-index: 0;
  left: -10%;
  top: -20%;
  overflow: visible;
}
.switch .s_wrapper .switch_bubble path {
  fill: #FFFFFF;
}
.switch .s_wrapper label {
  z-index: 1;
}

footer {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 0;
  text-align: center;
  padding: 16px 0;
  color: #FFFFFF;
}
footer a {
  color: #1e59af;
}
</style>

</head>
<body>
<!-- partial:index.partial.html -->
<div ng-app="app">
  <div id="page" ng-controller="switch_ctrl">
        <div class="switch">
          <div class="s_wrapper">
            <form action="" accept-charset="utf-8">
              <svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="32.323975mm" height="32.323978mm" viewBox="0 0 114.53377 114.53378" class="switch_bubble" version="1.1">
    <defs id="defs4"/>
    <metadata id="metadata7"/>
    <g id="layer1" transform="translate(-260.81948,-491.03328)">
      <path d="m375.35325 548.30017a57.266888 57.266888 0 0 1-57.26689 57.26689 57.266888 57.266888 0 0 1-57.26688-57.26689 57.266888 57.266888 0 0 1 57.26688-57.26689 57.266888 57.266888 0 0 1 57.26689 57.26689z" id="path4136" fill="#000"/>
    </g>
  </svg>
              <label>
                <input type="radio"  name="area" ng-model="action.mode" value="view" ng-change="bubblisity()">
                <md-icon>
                  view_list
                </md-icon>
              </label>
              <label>
                <input type="radio&q.........完整代码请登录后点击上方下载按钮下载查看

网友评论0