<style type="text/css">
*{margin: 0px;padding: 0px;}
.bucSelectedButton{width: 100px;line-height: 30px;text-align: center;position: relative;}
.bucSelected {border:1px solid rgb(195,195,195);color:#000;cursor: pointer;border-radius: 6px;background-color: rgb(255,255,255);}
.bucSelectedHover{border: 1px solid rgb(74,201,255);color: rgb(74,201,255);cursor: pointer;border-radius: 6px;background-color: rgb(238,249,254);}
.bucSelectedHover .tip {color: rgb(0,0,0);background-color: rgb(255,255,255);}
</style>
<div ng-controller="bucTipController"> <!-- 指令 --> <buc-button id="numberType" my-title="按钮" tip-title = "这个是提示" style="margin-top:60px;"></buc-button> </div>
<script type="text/javascript">
var app = angular.module("tip",[]);
app.controller("bucTipController",function(){
})
.directive("bucButton",function(){
return {
restrict : 'E',
replace : true,
scope : {
myTitle : "@",
id : "@",
tipTitle : "@"
},
template : "<button class='bucSelectedButton bucSelected' ng-click='clicked()' ng-mouseover = 'mouseover()' ng-mouseout = 'mouseout()'>{{myTitle}}\
<div style='border:1px solid #dcdcdc;border-radius:6px;width:auto;height:20px;line-height:20px;position:absolute;top:-40px;padding:5px;white-space:nowrap;background-color:#fafafa;display:none;color:#000;left:20px;' class='tip'>{{tipTitle}}\
<span style='position:absolute;top:25px;left:10px;background-color:#fafafa;border:1px solid #dcdcdc;width:10px;height:10px;transform:rotate(45deg);border-left:none;border-top:none;'>\
</span>\
</div>\
</button>",
link : function(scope,elem,attrs) {
scope.mouseover = function(){
$(".tip").show();
}
scope.mouseout = function(){
$(".tip").hide();
}
scope.clicked = function(){
elem.toggleClass("bucSelectedHover");
$(".tip").hide();
}
}
}
})
</script>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有