第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么我的每次滑過(guò),提示框的位置都會(huì)變化啊

<!doctype?html>
<html>
<head>
<meta?charset="utf-8">
<title>按鈕特效</title>
<style?type="text/css">
*
{
	margin:0;padding:0
}
body
{
	background:#666;
}
.box
{
	width:800px;
	height:280px;
	margin:50px??auto;
	position:relative;
}
.box?.link
{
	width:205px;
	height:280px;
	float:left;
	margin:0?20px;
}
.link?.icon
{
	display:inline-block;
	width:100%;
	height:190px;
	transition:all?0.2s?ease-out;
	
}
.link_miss?.icon
{
	background:url(yy.png)?no-repeat?center?center;
}
.link_play?.icon
{
	background:url(yy.png)?no-repeat?center?center;
}
.link_touch?.icon
{
	background:#F6C;
}
.link?.icon:hover{transform:rotate(360deg)?scale(1.2);/*這是css3的動(dòng)畫旋轉(zhuǎn)特效*/
??????????????????}
.button
{
	padding-left:10px;
	width:180px;
	height:50px;
	line-height:50px;
	text-decoration:none;
	color:#0C0;
	font-family:"微軟雅黑";
	font-weight:bolder;
	border:2px?solid?rgba(255,255,255,0.5);
	display:block;
	box-sizing:border-box;/*這是css3的新屬性,這個(gè)意思是按照設(shè)定的歡度和高度執(zhí)行?,自動(dòng)排除了邊框*/
	background:url(jj.png)?no-repeat??130px?center;
	transition:all?0.4s?ease;
	position:relative;
}
.button:hover
{
	border:2px?solid?rgba(255,255,255,1);
	background-position:140px?center;
}
.button?.line
{
	display:block;
	position:absolute;
	background:none;
	transition:all?0.4s?ease
}
.button:hover?.line
{
	background:#fff;
}
.button?.line_top
{???
????left:-100%;
	top:-2px;
	width:0;
	height:2px;
	
}
.button:hover?.line_top
{
	width:100%;
	left:-2px;
}
.button?.line_left
{
	width:2px;
	height:0;
	left:-2px;
	bottom:-120%;
}
.button:hover?.line_left
{
	height:100%;
	bottom:-2px;
	
}
.button?.line_bottom
{
	width:0;
	right:-100%;
	height:2px;
	bottom:-2px;
}
.button:hover?.line_bottom
{
	width:100%;
	right:-2px;
	
}
.button?.line_right
{
	width:2px;
	height:0;
	right:-2px;
	top:-110%;
}
.button:hover?.line_right
{?
???height:100%;
???top:-2px;
???/*這是css3的動(dòng)畫過(guò)渡特性*/
}
.tip
{
	position:absolute;
	padding:0?14px;
	height:35px;
	line-height:35px;
	background:#0F0;
	color:#fff;
	font-size:18px;
	border-radius:3px;/*圓角屬性*/
	margin:0?auto;
	top:100px;
	opacity:0;/*css3屬性設(shè)置元素的透明度*/
}
.tip?em
{
	font-style:normal;
}
.tip?span
{
	display:block;
	width:0;
	height:0;
	border:7px?solid?transparent;
	border-top-color:#0F0;
	position:absolute;
	top:35px;
	left:50%;
	margin-left:-3.5px;
}
	
</style>
<script?src="http://libs.baidu.com/jquery/1.8.0/jquery.js"?type="text/javascript"></script>
<script>
$(function(){
	$(".link?.button").hover(function(){
		var?title=$(this).attr("date");//先獲取滑過(guò)的按鈕的data屬性值
		var?pos=$(this).position().left;//position()屬性是獲取元素和加了定位的父元素之間的距離?包括top和left
		var?dis=($(".tip").outerWidth()-$(this).outerWidth())/2;
		var?sj=pos-dis;
		$(".tip?em").text(title);//吧獲取到的date的值?放在html結(jié)構(gòu)的em中
		$(".tip").css({"left":sj+"px"}).animate({"top":145,"opacity":1},500);
		
		},
		function(){
			
			$(".tip").animate({"top":100,"opacity":0},500);
			})
	
	})
</script>
</head>

<body>
<div?class="box">
??????<div?class="link??link_miss">
???????????<span?class="icon"></span>
???????????<a?href="#"?class="button"?date="這是mission?aaaaaaaaa">mission
????????????????<span?class="line?line_top"></span>
????????????????<span?class="line?line_right"></span>
????????????????<span?class="line?line_bottom"></span>
????????????????<span?class="line?line_left"></span>
???????????</a>
??????</div><!--第一個(gè)按鈕結(jié)束-->
??????
??????<div?class="link??link_play">
???????????<span?class="icon"></span>
???????????<a?href="#"?class="button"?date="這是play?bbbbbbbbbbbb">play
????????????????<span?class="line?line_top"></span>
????????????????<span?class="line?line_right"></span>
????????????????<span?class="line?line_bottom"></span>
????????????????<span?class="line?line_left"></span>
???????????</a>
??????</div><!--第二個(gè)按鈕結(jié)束-->
??????
??????<div?class="link??link_touch">
???????????<span?class="icon"></span>
???????????<a?href="#"?class="button"?date="這是touch?ccccccccccccccc">touch
????????????????<span?class="line?line_top"></span>
????????????????<span?class="line?line_right"></span>
????????????????<span?class="line?line_bottom"></span>
????????????????<span?class="line?line_left"></span>
???????????</a>
??????</div><!--第三個(gè)按鈕結(jié)束-->
??????
?????<div?class="tip"><em></em><span></span></div>?
</div>
</body>
</html>


正在回答

1 回答

var?dis=($(".tip").outerWidth()-$(this).outerWidth())/2;?
var?sj=pos-dis;
$(".tip?em").text(title);//吧獲取到的date的值?放在html結(jié)構(gòu)的em中

應(yīng)該是取的寬度不對(duì),你是先取的 .tip 的寬度才設(shè)置 .tip em 的內(nèi)容,應(yīng)該先設(shè)置 .tip em 的內(nèi)容后再取 .tip 的寬度,不然取的寬度上一次內(nèi)容的寬度,應(yīng)該改成這樣就行了

$(".tip?em").text(title);//吧獲取到的date的值?放在html結(jié)構(gòu)的em中
var?dis=($(".tip").outerWidth()-$(this).outerWidth())/2;?
var?sj=pos-dis;


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
按鈕特效
  • 參與學(xué)習(xí)       51384    人
  • 解答問(wèn)題       239    個(gè)

WEB前端開發(fā)必備能力,課程分為二個(gè)實(shí)例講解,讓你牢牢掌握

進(jìn)入課程

為什么我的每次滑過(guò),提示框的位置都會(huì)變化啊

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)