Èç¹ûÄãÊÇÒ»ÃûÇ°¶Ëer,ÓÖÏëÔÚÒƶ¯É豸ÉÏ¿ª·¢³ö×Ô¼ºµÄÓ¦Óã¬ÄÇÔõôʵÏÖÄØ£¿ÐҺã¬webkitÄں˵Ää¯ÀÀÆ÷ÄÜ°ïÖúÎÒÃÇÍê³ÉÕâÒ»ÇС£½Ó´¥
webkit webAppµÄ¿ª·¢ÒѾÓÐÒ»¶Îʱ¼äÁË£¬ÏÖ°ÑһЩ¼¼ÇÉ·ÖÏí¸ø´ó¼Ò £º
1. viewport£º
Ò²¾ÍÊÇ¿ÉÊÓÇøÓò¡£¶ÔÓÚ×ÀÃæä¯ÀÀÆ÷£¬ÎÒÃǶ¼ºÜÇå³þviewportÊÇʲô£¬¾ÍÊdzöÈ¥ÁËËùÓй¤¾ßÀ¸¡¢×´Ì¬À¸¡¢¹ö¶¯ÌõµÈµÈÖ®ºóÓÃÓÚ¿´ÍøÒ³µÄÇøÓò£¬
ÕâÊÇÕæÕýÓÐЧµÄÇøÓò¡£ÓÉÓÚÒƶ¯É豸ÆÁÄ»¿í¶È²»Í¬ÓÚ´«Í³web,Òò´ËÎÒÃÇÐèÒª¸Ä±äviewport;
ʵ¼ÊÉÏÎÒÃÇ¿ÉÒÔ²Ù×÷µÄÊôÐÔÓÐ4 ¸ö£º
width - // viewport µÄ¿í¶È £¨·¶Î§´Ó200 µ½10,000£¬Ä¬ÈÏΪ980 ÏñËØ£©
height - // viewport µÄ¸ß¶È £¨·¶Î§´Ó223 µ½10,000£©
initial-scale - // ³õʼµÄËõ·Å±ÈÀý £¨·¶Î§´Ó>0 µ½10£©
minimum-scale - // ÔÊÐíÓû§Ëõ·Åµ½µÄ×îС±ÈÀý
maximum-scale - // ÔÊÐíÓû§Ëõ·Åµ½µÄ×î´ó±ÈÀý
user-scalable - // Óû§ÊÇ·ñ¿ÉÒÔÊÖ¶¯Ëõ (no,yes)
|
ÄÇôµ½µ×ÕâЩÉèÖÃÈçºÎÈÃSafari ÖªµÀ£¿ÆäʵºÜ¼òµ¥£¬¾ÍÒ»¸ömeta£¬ÐÎÈ磺
//±àÂë
// ÀëÏßÓ¦ÓõÄÁíÒ»¸ö¼¼ÇÉ
// Òþ²Ø״̬À¸
//Ö¸¶¨µÄiphoneÖÐsafari¶¥¶ËµÄ״̬ÌõµÄÑùʽ
//¸æËßÉ豸ºöÂÔ½«Ò³ÃæÖеÄÊý×Öʶ±ðΪµç»°ºÅÂë |
ÔÚÉèÖÃÁËinitial-scale=1 Ö®ºó£¬ÎÒÃÇÖÕÓÚ¿ÉÒÔÒÔ1:1 µÄ±ÈÀý½øÐÐÒ³ÃæÉè¼ÆÁË¡£¹ØÓÚviewport£¬»¹ÓÐÒ»¸öºÜÖØÒªµÄ¸ÅÄîÊÇ£ºiphone
µÄsafari ä¯ÀÀÆ÷ÍêȫûÓйö¶¯Ìõ£¬¶øÇÒ²»ÊǼòµ¥µÄ¡°Òþ²Ø¹ö¶¯Ìõ¡±£¬ÊǸù±¾Ã»ÓÐÕâ¸ö¹¦ÄÜ¡£iphone µÄsafari
ä¯ÀÀÆ÷ʵ¼ÊÉÏ´ÓÒ»¿ªÊ¼¾ÍÍêÕûÏÔʾÁËÕâ¸öÍøÒ³£¬È»ºóÓÃviewport ²é¿´ÆäÖеÄÒ»²¿·Ö¡£µ±ÄãÓÃÊÖÖ¸Í϶¯Ê±£¬ÆäʵÍϵIJ»ÊÇÒ³Ã棬¶øÊÇviewport¡£ä¯ÀÀÆ÷ÐÐΪµÄ¸Ä±ä²»Ö¹Êǹö¶¯Ìõ£¬½»»¥Ê¼þÒ²¸úÆÕͨ×ÀÃæ²»Ò»Ñù¡£(Çë²Î¿¼£ºÖ¸¼âµÄÏÂJS
ϵÁÐÎÄÕÂ)
2. link:
<link rel=¡±apple-touch-startup-image¡± href=¡±startup.png¡± /> // ÉèÖÿªÊ¼Ò³ÃæͼƬ
<link rel=¡±apple-touch-icon¡± href=¡±iphon_tetris_icon.png¡±/>
// ÔÚÉèÖÃÊéÇ©µÄʱºò¿ÉÒÔÏÔʾºÃ¿´µÄͼ±ê
<link rel="stylesheet" media="all
and (orientation:portrait)" href="portrait.css">
// ФÏñģʽÑùʽ
<link rel="stylesheet" media="all
and (orientation:landscape)" href="landscape.css"
// ·ç¾°Ä£Ê½Ñùʽ
//ÊúÆÁʱʹÓõÄÑùʽ
<style media="all and (orientation:portrait)"
type="text/css">
#landscape { display: none; }
</style>
//ºáÆÁʱʹÓõÄÑùʽ
<style media="all and (orientation:landscape)"
type="text/css">
#portrait { display: none; }
</style> |
3. ʼþ £º (Çë²Î¿¼£ºÖ¸¼âµÄÏÂJS ϵÁÐÎÄÕÂ)
// ÊÖÊÆʼþ
touchstart //µ±ÊÖÖ¸½Ó´¥ÆÁĻʱ´¥·¢
touchmove //µ±ÒѾ½Ó´¥ÆÁÄ»µÄÊÖÖ¸¿ªÊ¼Òƶ¯ºó´¥·¢
touchend //µ±ÊÖÖ¸À뿪ÆÁĻʱ´¥·¢
touchcancel
// ´¥Ãþʼþ
gesturestart //µ±Á½¸öÊÖÖ¸½Ó´¥ÆÁĻʱ´¥·¢
gesturechange //µ±Á½¸öÊÖÖ¸½Ó´¥ÆÁÄ»ºó¿ªÊ¼Òƶ¯Ê±´¥·¢
gestureend
// ÆÁÄ»Ðýתʼþ
onorientationchange
// ¼ì²â´¥ÃþÆÁÄ»µÄÊÖÖ¸ºÎʱ¸Ä±ä·½Ïò
orientationchange
// touchʼþÖ§³ÖµÄÏà¹ØÊôÐÔ
touches
targetTouches
changedTouches
clientX¡¡¡¡¡¡¡¡// X coordinate of touch relative
to the viewport (excludes scroll offset)
clientY¡¡¡¡¡¡¡¡// Y coordinate of touch relative
to the viewport (excludes scroll offset)
screenX¡¡¡¡¡¡ // Relative to the screen
screenY ¡¡¡¡ // Relative to the screen
pageX¡¡¡¡ ¡¡¡¡// Relative to the full page (includes
scrolling)
pageY¡¡¡¡¡¡¡¡ // Relative to the full page (includes
scrolling)
target¡¡¡¡¡¡¡¡ // Node the touch event originated
from
identifier¡¡¡¡ // An identifying number, unique
to each touch event |
4. ÆÁÄ»Ðýתʼþ£ºonorientationchange
Ìí¼ÓÆÁÄ»ÐýתʼþÕìÌý£¬¿ÉËæʱ·¢ÏÖÆÁÄ»Ðýת״̬£¨×óÐý¡¢ÓÒÐý»¹ÊÇûÐý£©¡£Àý×Ó£º
// ÅжÏÆÁÄ»ÊÇ·ñÐýת
function orientationChange() {
switch(window.orientation) {
¡¡¡¡case 0:
alert("ФÏñģʽ 0,screen-width: " + screen.width
+ "; screen-height:" + screen.height);
break;
¡¡¡¡case -90:
alert("×óÐý -90,screen-width: " + screen.width
+ "; screen-height:" + screen.height);
break;
¡¡¡¡case 90:
alert("ÓÒÐý 90,screen-width: " + screen.width
+ "; screen-height:" + screen.height);
break;
¡¡¡¡case 180:
¡¡¡¡alert("·ç¾°Ä£Ê½ 180,screen-width: "
+ screen.width + "; screen-height:"
+ screen.height);
¡¡¡¡break;
};<br>};
// Ìí¼Óʼþ¼àÌý
addEventListener('load', function(){
orientationChange();
window.onorientationchange = orientationChange;
}); |
5. Òþ²ØµØÖ·À¸ & ´¦ÀíʼþµÄʱºò£¬·ÀÖ¹¹ö¶¯Ìõ³öÏÖ£º
// Òþ²ØµØÖ·À¸ & ´¦ÀíʼþµÄʱºò £¬·ÀÖ¹¹ö¶¯Ìõ³öÏÖ
addEventListener('load', function(){
setTimeout(function(){ window.scrollTo(0, 1);
}, 100);
}); |
6. Ë«ÊÖÖ¸»¬¶¯Ê¼þ£º
// Ë«ÊÖÖ¸»¬¶¯Ê¼þ
addEventListener('load',¡¡¡¡function(){ window.onmousewheel
= twoFingerScroll;},
false // ¼æÈݸ÷ä¯ÀÀÆ÷£¬±íʾÔÚðÅݽ׶ε÷ÓÃʼþ´¦Àí³ÌÐò (true ²¶»ñ½×¶Î)
);
function twoFingerScroll(ev) {
var delta =ev.wheelDelta/120; //¶Ô delta Öµ½øÐÐÅжÏ(±ÈÈçÕý¸º)
£¬¶øºóÖ´ÐÐÏàÓ¦²Ù×÷
return true;
}; |
7. ÅжÏÊÇ·ñΪiPhone£º
// ÅжÏÊÇ·ñΪ iPhone £º
function isAppleMobile() {
return (navigator.platform.indexOf('iPad') !=
-1);
}; |
8. localStorage:
Àý×Ó £º£¨×¢ÒâÊý¾ÝÃû³Æ n ÒªÓÃÒýºÅÒýÆðÀ´£©
var v = localStorage.getItem('n') ? localStorage.getItem('n') : ""; // Èç¹ûÃû³ÆÊÇ n µÄÊý¾Ý´æÔÚ £¬Ôò½«Æä¶Á³ö £¬¸³Óè±äÁ¿ v ¡£
localStorage.setItem('n', v); // дÈëÃû³ÆΪ n¡¢ÖµÎª v
µÄÊý¾Ý
localStorage.removeItem('n'); // ɾ³ýÃû³ÆΪ n µÄÊý¾Ý
|
9. ʹÓÃÌØÊâÁ´½Ó£º
Èç¹ûÄã¹Ø±Õ×Ô¶¯Ê¶±ðºó £¬ÓÖÏ£ÍûijЩµç»°ºÅÂëÄܹ»Á´½Óµ½ iPhone µÄ²¦ºÅ¹¦ÄÜ
£¬ÄÇô¿ÉÒÔͨ¹ýÕâÑùÀ´ÉùÃ÷µç»°Á´½Ó ,
<a href="tel:12345654321">´òµç»°¸øÎÒ</a>
<a href="sms:12345654321">·¢¶ÌÐÅ</a>
»òÓÃÓÚµ¥Ôª¸ñ£º
<td onclick="location.href='tel:122'"> |
10. ×Ô¶¯´óдÓë×Ô¶¯ÐÞÕý
Òª¹Ø±ÕÕâÁ½ÏÄÜ£¬¿ÉÒÔͨ¹ýautocapitalize Óëautocorrect
ÕâÁ½¸öÑ¡Ï
<input type="text" autocapitalize="off" autocorrect="off" /> |
11. WebKit CSS:
¢Ù¡°ºÐÄ£ÐÍ¡±µÄ¾ßÌåÃèÊöÐÔÖʵİüΧºÐ¿éÄÚÈÝ£¬°üÀ¨±ß½ç£¬Ìî³äµÈµÈ¡£
-webkit-border-bottom-left-radius: radius;
-webkit-border-top-left-radius: horizontal_radius
vertical_radius;
-webkit-border-radius: radius; //ÈÝÆ÷Ô²½Ç
-webkit-box-sizing: sizing_model; ±ß¿ò³£Á¿Öµ£ºborder-box/content-box
-webkit-box-shadow: hoff voff blur color; //ÈÝÆ÷ÒõÓ°£¨²ÎÊý·Ö±ðΪ£ºË®Æ½X
·½ÏòÆ«ÒÆÁ¿£»´¹Ö±Y ·½ÏòÆ«ÒÆÁ¿£»¸ß˹ģºý°ë¾¶Öµ£»ÒõÓ°ÑÕÉ«Öµ£©
-webkit-margin-bottom-collapse: collapse_behavior;
³£Á¿Öµ£ºcollapse/discard/separate
-webkit-margin-start: width;
-webkit-padding-start: width;
-webkit-border-image: url(borderimg.gif) 25 25
25 25 round/stretch round/stretch;
-webkit-appearance: push-button; //ÄÚÖõÄCSS ±íÏÖ£¬ÔÝʱֻ֧³Öpush-button |
¢Ú¡°ÊÓ¾õ¸ñʽ»¯Ä£ÐÍ¡±ÃèÊöÐÔÖÊ£¬È·¶¨ÁËλÖúʹóСµÄ¿éÔªËØ¡£
direction: rtl
unicode-bidi: bidi-override; ³£Á¿£ºbidi-override/embed/normal
|
¢Û¡°ÊÓ¾õЧ¹û¡±ÃèÊöÊôÐÔ£¬µ÷ÕûµÄÊÓ¾õЧ¹û¿éÄÚÈÝ£¬°üÀ¨Òç³öÐÐΪ£¬µ÷ÕûÐÐΪ£¬Äܼû¶È£¬¶¯»£¬±ä»»£¬ºÍ¹ý¶É¡£
clip: rect(10px, 5px, 10px, 5px)
resize: auto; ³£Á¿£ºauto/both/horizontal/none/vertical
visibility: visible; ³£Á¿: collapse/hidden/visible
-webkit-transition: opacity 1s linear; ¶¯»Ð§¹û ease/linear/ease-in/ease-out/ease-in-out
-webkit-backface-visibility: visibler; ³£Á¿£ºvisible(ĬÈÏÖµ)/hidden
-webkit-box-reflect: right 1px; ¾µÏò·´×ª
-webkit-box-reflect: below 4px -webkit-gradient(linear,
left top, left bottom,
from(transparent), color-stop(0.5, transparent),
to(white));
-webkit-mask-image: -webkit-gradient(linear,
left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)));;
//CSS ÕÚÕÖ/ÃÉ°åЧ¹û
-webkit-mask-attachment: fixed; ³£Á¿£ºfixed/scroll
-webkit-perspective: value; ³£Á¿£ºnone(ĬÈÏ)
-webkit-perspective-origin: left top;
-webkit-transform: rotate(5deg);
-webkit-transform-style: preserve-3d; ³£Á¿£ºflat/preserve-3d;
(2D Óë3D) |
¢Ü¡°Éú³ÉµÄÄÚÈÝ£¬×Ô¶¯±àºÅ£¬²¢Áгö¡±ÃèÊöÊôÐÔ£¬ÔÊÐíÄú¸ü¸ÄÄÚÈݵÄÒ»¸ö×é³É²¿·Ö£¬´´½¨×Ô¶¯±àºÅµÄÕ½ںͱêÌ⣬ºÍ²Ù×ݵķç¸ñÇåµ¥µÄÄÚÈÝ¡£
content: ¡°Item¡± counter(section) ¡± ¡°;
This resets the counter.
First section
>two section
three section
counter-increment: section 1;
counter-reset: section; |
¢Ý¡°·ÖҳýÌ塱ÃèÊöÐÔÄÜÓëÍâ¹ÛµÄÊôÐÔ£¬¿ØÖÆÓ¡Ë¢°æ±¾µÄÍøÒ³£¬Èç·ÖÒ³·ûµÄÐÐΪ¡£
page-break-after: auto; ³£Á¿£ºalways/auto/avoid/left/right
page-break-before: auto; ³£Á¿£ºalways/auto/avoid/left/right
page-break-inside: auto; ³£Á¿£ºauto/avoid |
¢Þ¡°ÑÕÉ«ºÍ±³¾°¡±ÃèÊöÊôÐÔ¿ØÖƱ³¾°ÏµĿ鼶ԪËغÍÑÕÉ«µÄÎı¾ÄÚÈݵÄ×é³É²¿·Ö¡£
-webkit-background-clip: content; ³£Á¿£ºborder/content/padding/text
-webkit-background-origin: padding; ³£Á¿£ºborder/content/padding/text
-webkit-background-size: 55px; ³£Á¿£ºlength/length_x/length_y |
¢ß ¡°×ÖÐÍ¡±µÄ¾ßÌåÃèÊöÐÔÖʵÄÎÄ×Ö×ÖÌåµÄÑ¡Ôñ·¶Î§ÄÚµÄÒ»¸öÒòËØ¡£±¨¸æ»¹ÃèÊöÊôÐÔÓÃÓÚÏÂÔØ×ÖÌ嶨Òå¡£
unicode-range: U+00-FF, U+980-9FF; |
¢à¡°Îı¾¡±ÃèÊöÊôÐÔµÄÌض¨ÎÄ×ÖÑùʽ£¬¼ä¾àºÍ×Ô¶¯¹öÆÁ¡£
text-shadow: #00FFFC 10px 10px 5px;
text-transform: capitalize; ³£Á¿£ºcapitalize/lowercase/none/uppercase
word-wrap: break-word; ³£Á¿£ºbreak-word/normal
-webkit-marquee: right large infinite normal
10s; ³£Á¿£ºdirection(·½Ïò) increment(µü´ú´ÎÊý) repetition(Öظ´)
style(Ñùʽ) speed(ËÙ¶È);
-webkit-marquee-direction: ahead/auto/backwards/down/forwards/left/reverse/right/up
-webkit-marquee-incrementt: 1-n/infinite(ÎÞÇî´Î)
-webkit-marquee-speed: fast/normal/slow
-webkit-marquee-style: alternate/none/scroll/slide
-webkit-text-fill-color: #ff6600; ³£Á¿£ºcapitalize,
lowercase, none, uppercase
-webkit-text-security: circle; ³£Á¿£ºcircle/disc/none/square
-webkit-text-size-adjust: none; ³£Á¿:auto/none;
-webkit-text-stroke: 15px #fff;
-webkit-line-break: after-white-space; ³£Á¿£ºnormal/after-white-space
-webkit-appearance: caps-lock-indicator;
-webkit-nbsp-mode: space; ³£Á¿£º normal/space
-webkit-rtl-ordering: logical; ³£Á¿£ºvisual/logical
-webkit-user-drag: element; ³£Á¿£ºelement/auto/none
-webkit-user-modify: read- only; ³£Á¿£ºread-write-plaintext-only/read-write/read-only
-webkit-user-select: text; ³£Á¿£ºtext/auto/none |
¢á¡°±í¸ñ¡±ÃèÊöµÄ²¼¾ÖºÍÉè¼ÆÐÔÄܱíµÄ¾ßÌåÄÚÈÝ¡£
-webkit-border-horizontal-spacing: 2px;
-webkit-border-vertical-spacing: 2px;
-webkit-column-break-after: right; ³£Á¿£ºalways/auto/avoid/left/right
-webkit-column-break-before: right; ³£Á¿£ºalways/auto/avoid/left/right
¨Cwebkit-column-break-inside: logical; ³£Á¿£ºavoid/auto
-webkit-column-count: 3; //·ÖÀ¸
-webkit-column-rule: 1px solid #fff;
style:dashed,dotted,double,groove,hidden,inset,none,outset,ridge,solid |
¢â¡°Óû§½çÃ桱ÃèÊöÊôÐÔ£¬Éæ¼°µ½Óû§½çÃæÔªËØÔÚä¯ÀÀÆ÷ÖУ¬Èç¹ö¶¯ÎÄ×ÖÇø£¬¹ö¶¯Ìõ£¬µÈµÈ¡£±¨¸æ»¹ÃèÊöÊôÐÔ£¬·¶Î§ÒÔÍâµÄÍøÒ³ÄÚÈÝ£¬Èç¹â±êµÄ±ê×¢ÑùʽºÍÏÔʾµ±Äú°´×¡´¥Ãþ´¥ÃþÄ¿±ê£¬ÈçÔÚiPhoneÉϵÄÁ´½Ó¡£
-webkit-box-align: baseline,center,end,start,stretch ³£Á¿£ºbaseline/center/end/start/stretch
-webkit-box-direction: normal;³£Á¿£ºnormal/reverse
-webkit-box-flex: flex_valuet
-webkit-box-flex-group: group_number
-webkit-box-lines: multiple; ³£Á¿£ºmultiple/single
-webkit-box-ordinal-group: group_number
-webkit-box-orient: block-axis; ³£Á¿£ºblock-axis/horizontal/inline-axis/vertical/orientation
¨Cwebkit-box-pack: alignment; ³£Á¿£ºcenter/end/justify/start |
12. ¶¯»¹ý¶É
ÕâÊÇ Webkit ÖÐ×î¾ß´´ÐÂÁ¦µÄÌØÐÔ£ºÊ¹Óùý¶Éº¯Êý¶¨Ò嶯»¡£
-webkit-animation: title infinite ease-in-out 3s;
animation ÓÐÕ⼸¸öÊôÐÔ£º
-webkit-animation-name£º //ÊôÐÔÃû£¬¾ÍÊÇÎÒÃǶ¨ÒåµÄkeyframes
-webkit-animation-duration£º3s //³ÖÐøʱ¼ä
-webkit-animation-timing-function£º //¹ý¶ÉÀàÐÍ£ºease/
linear(ÏßÐÔ) /ease-in(Âýµ½¿ì)/ease-out(¿ìµ½Âý) /ease-in-out(Âýµ½¿ìÔÙµ½Âý)
/cubic-bezier
-webkit-animation-delay£º10ms //¶¯»ÑÓ³Ù(ĬÈÏ0)
-webkit-animation-iteration-count£º //Ñ»·´ÎÊý(ĬÈÏ1)£¬infinite
ΪÎÞÏÞ
-webkit-animation-direction£º //¶¯»·½Ê½£ºnormal(ĬÈÏ
ÕýÏò²¥·Å)£» alternate(½»Ìæ·½Ïò£¬µÚżÊý´ÎÕýÏò²¥·Å£¬µÚÆæÊý´Î·´Ïò²¥·Å) |
ÕâЩͬÑùÊÇ¿ÉÒÔ¼òдµÄ¡£µ«ÕæÕýÈÃÎÒ¾õµÄºÜˬµÄÊÇkeyframes£¬ËüÄܶ¨ÒåÒ»¸ö¶¯»µÄת±ä¹ý³Ì¹©µ÷Ó㬹ý³ÌΪ0%µ½100%»òfrom(0%)µ½to(100%)¡£¼òµ¥µã˵£¬Ö»ÒªÄãÓÐÏë·¨£¬ÄãÏëÈÃÔªËØÔÚÕâ¸ö¹ý³ÌÖÐÒÔʲôÑùµÄ·½Ê½¸Ä±ä¶¼ÊǺܼòµ¥µÄ¡£
-webkit-transform: ÀàÐÍ£¨Ëõ·Åscale/Ðýתrotate/Çãбskew/λÒÆtranslate£©
scale(num,num) ·Å´ó±¶ÂÊ¡£scaleX ºÍ scaleY(3)£¬¿ÉÒÔ¼òдΪ£ºscale(*
, *)
rotate(*deg) ת¶¯½Ç¶È¡£rotateX ºÍ rotateY£¬¿ÉÒÔ¼òдΪ£ºrotate(*
, *)
Skew(*deg) Çãб½Ç¶È¡£skewX ºÍskewY£¬¿É¼òдΪ£ºskew(* , *)
translate(*,*) ×ø±êÒƶ¯¡£translateX ºÍtranslateY£¬¿É¼òдΪ£ºtranslate(*
, *)¡£ |
ʵÏÖÄ£Äⵯ³öÏûÏ¢¿ò£¨Alert£©µÄÀý×Ó£º
¢Ù¶¨Òå¹ý¶É£¨ÔÚ<style type="text/css">¶ÎÖÐÃèÊökeyframes£©£º
@-webkit-keyframes DivZoom
{
0% { -webkit-transform: scale(0.01) }
60% { -webkit-transform: scale(1.05) }
80% { -webkit-transform: scale(0.95) }
100% { -webkit-transform: scale(1.00) }
}
.sZoom { -webkit-animation: DivZoom 0.5s ease-in-out
} |
£¨ºÜÈÝÒ׿´¶®£¬½«ÔªËØ´ÓËõСµÄ0.01 ±¶--ºÜСµ«²»ÄÜΪ0 ±¶£¬·Å´óµ½1.05
±¶£¬ÔÙËõСµ½0.95±¶£¬×îºóµ½1 ±¶¼´Õý³£´óС¡£Õû¸ö¹ý¶É¹ý³ÌʼþΪ0.5 Ã룬¶¯»·½Ê½Îªease-in-out£¬¼´Âýµ½¿ìÔÙµ½Âý£¬Ä¬ÈÏÖ»½øÐÐ1
´Î¹ý¶É¡£ÕâÕýÊÇ´ó¼Ò¾³£¿´µ½µÄ iPhone µ¯³öµÄÌáʾÐÅÏ¢µÄ¶¯»Ð§¹û£¡£©
¢Ú¶¨ÒåÔªËØ£¨ÔÚ<body>¶ÎÖУ©£º
<div id="layerH" style="-webkit-border-radius:12px; border:2px solid #FFF;
-webkit-box-shadow: 0px 2px 4px #888;position: absolute; left: 24px; top: 106px;
<br>width: 256px; height: 268px; padding-left: 8px; padding-right: 8px;color: #FFFFFF;
text-shadow: 1px 1px 1px #000; text-align: center;background-color: RGBA(32,48,96,0.9);
background-image:url('BG-Msg.png'); background-repeat:no-repeat;
z-index: 1; visibility: hidden; ">
<p><span style="font-size: 16pt;
font-weight: bold">ʹÓÃ˵Ã÷</span></p>
<hr noshade size="1">
<div id="HelpText" style="height:
120px">˵Ã÷ÎÄ×Ö</div>
<hr noshade size="1">
<form name="formV" method="POST">
<input type="button" value="È·ÈÏ"
name="B1"
style="width: 100%; height: 40px; font-size:
14pt; ont-weight: bold;
color: #FFFFFF; text-shadow: 0px -1px 1px #000;"
onclick=" layerH.style.visibility='hidden'">
</form>
</div> |
¢ÛÆô¶¯¶¯»£¨ÔÚ javascript ¶¨ÒåµÄº¯ÊýÖУ©
function pHelp()
{
layerH.style.visibility = 'visible'
layerH.style.cssText = "-webkit-animation-delay:
" + Math.random() + "ms"
layerH.className = 'sZoom'
} |
(Õâ¸öÆô¶¯º¯Êý¾ÍºÜºÃÀí½âÁË¡£µ«ÊÇΪʲôҪʹÓÃ-webkit-animation-delay Õâ¾äÄØ£¿ÒòΪµ±Ò»¸öÔªËعý¶ÉÏÔʾÍê³Éºó£¬ÈôÆäÑùʽûÓб仯£¬ÏÂÒ»´Î½«ÎÞ·¨½øÐйý¶É¶¯»ÏÔʾ¡£ÎÒÃÇÇÉÃîµÄÀûÓÃÆ䶯»ÑÓ³Ùʱ¼ä¶¨Ò壬ʹÆäÓÐËù±ä»¯£¬¾Í±ÜÃâÁËÉÏÊöÎÊÌâ¡£ÆäÖÐʹÓÃËæ»úÊýº¯ÊýMath.random()£¬²úÉúÒ»¸ö´óÓÚ0
СÓÚ1 µÄËæ»úÊý¡£µ±È»£¬ÑÓ³ÙÁãµã¼¸ºÁÃ룬Óû§ÊDz»»á²ì¾õµÄ¡£)
|