JavaScript Reference/Javascript Objects/page

Материал из Web эксперт
Версия от 18:30, 25 мая 2010; (обсуждение)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"page" Example

    
<html>
<head>
<style>@page:first { background-color: blue; }</style>
<script language="JavaScript">
function function1() {
    var m = document.styleSheets(0).pages(0);
    var n = m.pseudoClass;
    alert(n);
}
</script>
</head>
<body>
<input type="button" value="Click here for the name of the first @page rule" 
onclick="function1();">
</body>
</html>



"page" is applied to

Names noted with an asterisk (*) are JavaScript properties only.
+----------------+--------------------------------------------------------------+
| Applied_To     |pages*                                                        |
+----------------+--------------------------------------------------------------+



"page" JavaScript Properties

+----------------+--------------------------------------------------------------+
| JavaScript     |pseudoClass                     readOnly                      |
| Properties     |selector                        selectorText                  |
+----------------+--------------------------------------------------------------+



"page" Syntax and Note

Note:
Access to an @page rule. 
You can access the page object only by referencing the desired index in the 
pages collection.
    
Syntax:
    
document.styleSheets(index1).pages(index2).memberName