تصف هذه المقالة طريقة تقليل النافذة والتركيز بعد النقر على الرابط. شاركه للرجوع إليه. التحليل المحدد هو كما يلي:
هذا هو تأثير خاص JS. لم أره من قبل. عند النقر فوق رابط النص المحدد في الصفحة ، سيتم تضييق نطاق نافذة الصفحة وعرضه في المركز ، ثم سيتم عرض محتوى الارتباط في النافذة المركزية. آمل أن تكون المؤثرات الخاصة صفحة الويب هذه مفيدة في المستقبل.
انسخ الرمز كما يلي: <html> <head>
<title> مركز النافذة </title>
<meta http-equiv = content-type content = "text/html ؛ charset = gb2312">
</head>
<body bgcolor =#fef4d9> <br> <br>
<centre>
<span> يتم تكبير النافذة وتركزت </span>
</center> <br>
<centre>
<table bordercolor =#00ffff border = 5 borderlight = "Green">
<tbody>
<tr>
<td align = middle> <div align = "center"> <span> عرض تأثير JS </span> </viv> </td>
</r>
<tr>
<td align = left>
<div align = "center">
<script>
وظيفة this_win (w ، h) {
var ww = window.screen.width*w/100 ؛
var hh = window.screen.height*h/100 ؛
Window.Resizeto (WW ، HH) ؛
window.moveto (Math.ceil ((window.screen.width-ww)/2) ، math.ceil ((window.screen.height-hh)/2)) ؛
}
</script>
<a onclick = this_win (50،50) href = "#"> انقر هنا إلى Baidu </a>
</viv> </td> </tbody> </tbody> </table> </center>
</body>
</html>
آمل أن تكون هذه المقالة مفيدة لبرمجة JavaScript للجميع.