Ê×ÏÈͼƬÊÇÎÒ´Ó»¥ÁªÍøÉÏÏÂÔصģ¬ÏòÕâλǰ±²Ö¾´¡£ÎÒÓõÄÊÇchrome49£¬Ã»ÓмӲ»Í¬ä¯ÀÀÆ÷µÄǰ׺£¬jquery3.0£¬Í¼Æ¬×ÊÔ´·ÅÔÚÁËÎҵİٶÈÔÆÅÌÉÏ
(1)֪ʶԤ±¸ a.ä¯ÀÀÆ÷x¡¢y¡¢zÖáµÄ¸ÅÄî×óÊÖÊú´ú±íyÖᣬÓÒÊÖºá´ú±íxÖᣬ×óÓÒÊÖ°Ú³ÉÒ»¸öÊ®×Ö£¬zÖáÊǼ´´¹Ö±xÖáÒ²´¹Ö±yÖá´©¹ýx¡¢y½»µãµÄÒ»ÌõÖ±Ïß¡£
b. :nth-of-type(1)img:nth-of-type(1)£¬ËùÓÐÓÐ×ÓÔªËØimgµÄ¸¸ÔªËصĵÚÒ»¸öimg×ÓÔªËØ
body :nth-of-type(1) µÈͬÓÚbody *:nth-of-type(1)
(2)´úÂë<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<script type="text/javascript" src="debug-jquery-3.0.0.js"></script>
<script type="text/javascript" src="base.js"></script>
<link href="favicon.ico" type="image/x-icon">
<title>ΪÁËÉú»î</title>
<style type="text/css">
*
{
margin-top:0px;
padding:0;
}
body
{
position:absolute;
}
#lol
{
width:530px;
height:530px;
position:absolute;
}
#lol img
{
display:block;
position:absolute;
border:1px #6F0000 solid;
}
#lol img:nth-of-type(1)
{
animation: one 10s linear 3s infinite;
}
@keyframes one
{
to
{
transform: rotateX(360deg);
}
}
#lol img:nth-of-type(2)
{
animation: two 10s linear 2s infinite;
}
@keyframes two
{
to
{
transform: rotateY(360deg);
}
}
#lol img:nth-of-type(3)
{
animation: three 10s linear 1s infinite;
}
@keyframes three
{
to
{
transform:rotateZ(360deg);
}
}
</style>
<script type="text/javascript">
$(function()
{
$("#lol").centerPos();
//ÈÃlolÔªËØˮƽ´¹Ö±¾ÓÖÐÏÔʾ£¬centerPosÊÇ×Ô¶¨Ò庯Êý
})
$.fn.centerPos = function()
{
var parent;
this.each(function(index)
{
parent = this.parentNode;
if(parent == document.body)
{
parent = window;
}
var position = $(this).css("position");
if(position == "fixed" || position=="absolute")
{
$(this).css("left",($(parent).width()-this.offsetWidth)/2+"px")
¡¡