source: Dev/trunk/src/client/dojo/tests/window/test_scrollNoDTD.html

Last change on this file was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 4.8 KB
Line 
1<html>
2<head>
3                <title>dojo.window.scrollIntoView Test with No DTD</title>
4
5        <style type="text/css">
6                @import "../../resources/dojo.css";
7        </style>
8        <script type="text/javascript" src="../../dojo.js"
9                data-dojo-config="isDebug: true"></script>
10
11        <script type="text/javascript">
12                require(["doh", "dojo/dom", "dojo/dom-geometry", "dojo/sniff", "dojo/window", "dojo/domReady!"],
13                                function(doh, dom, domGeom, has, winUtils){
14                        doh.register("window.scrollNoDTD",
15                                function scrollIntoView(){
16                                        scrollTo(100,100);
17                                        var s2 = dom.byId('s2');
18                                        s2.scrollTop = s2.scrollLeft = 10;
19                                        winUtils.scrollIntoView('q2');
20                                        doh.is((has("mozilla") && !domGeom.isBodyLtr())? -87 : 87, s2.scrollLeft);
21                                        doh.is(113, s2.scrollTop);
22                                        doh.f(dojo.hasAttr(s2,'_offsetParent'));
23                                        doh.f(dojo.hasAttr(s2,'_parent'));
24                                        doh.f(dojo.hasAttr(s2,'_child'));
25                                        scrollTo(!domGeom.isBodyLtr() ? 4000 : 0, 4000);
26                                }
27                        );
28                        doh.run();
29                });
30        </script>
31</head>
32<body>
33        <center><h1>Manually scroll and click elements that have a border<br>and they should scroll into view</h1></center>
34        <input style="float:left;display:block;border:1px solid black;padding:50px;" onclick="dojo.window.scrollIntoView(this);return false;" value="">
35        <input style="float:right;display:block;border:100px solid black;" onclick="dojo.window.scrollIntoView(this);return false;" size="20" value="">
36        <br>
37        <table style="display:block;margin:200px;border:0 solid white;border-width:0 300px 0 200px;"><tr><td><div style="background-color:white;border:2px solid black;width:400px;" onclick="dojo.window.scrollIntoView(this)">&nbsp;</div></td></tr>
38        <tr><td><div style="width:1000px;background-color:white;border:1px solid black;" onclick="dojo.window.scrollIntoView(this)">&nbsp;</div></td></tr></table>
39        <div style="height:70px;width:200px;overflow-y:scroll;position:absolute;top:50%;left:50%;">
40                <p>&nbsp;</p>
41                <p style="padding:5px;border:2px solid black;" onclick="dojo.window.scrollIntoView(this)">&nbsp;</p>
42                <p>&nbsp;</p>
43                <p>&nbsp;</p>
44        </div>
45        <div style="height:70px;width:70px;position:absolute;top:600px;left:100px;padding:20px;border:10px solid black;" onclick="dojo.window.scrollIntoView(this)">&nbsp;</div>
46        <div style="border:0px solid red;border:50px solid white;">
47                <img src="../../../dojo/resources/blank.gif" style="height:300px;width:1px;display:block;background-color:white;">
48                <div id="s1" style="width:600px;height:500px;overflow:scroll;background-color:white;border:0px solid white;margin:0px;padding:30px;"
49                        ><img src="../../../dojo/resources/blank.gif" style="border:1px solid black;height:100px;width:498px;display:block;margin:0 300px 0 0;" onclick="dojo.window.scrollIntoView(this)"
50                        ><nobr id="p1" style="display:block;border:0px;padding:0px;margin:0px;"
51                                ><img id="c1" src="../../../dojo/resources/blank.gif" style="height:400px;width:100px;display:inline;border:1px solid black;" onclick="dojo.window.scrollIntoView(this)"
52                                ><img id="q1" src="../../../dojo/resources/blank.gif" width=500 height=400 style="background-color:white;display:inline;border:50px solid black;" onclick="dojo.window.scrollIntoView(this)"
53                                ><img id="t1" src="../../../dojo/resources/blank.gif" style="height:400px;width:200px;display:inline;border:5px solid black;" onclick="dojo.window.scrollIntoView(this)"
54                        ></nobr
55                        ><img src="../../../dojo/resources/blank.gif" style="border:1px solid black;height:200px;width:598px;margin:0 0 0 300px;display:block;" onclick="dojo.window.scrollIntoView(this)"
56                ></div>
57                <img src="../../../dojo/resources/blank.gif" style="height:200px;width:1px;display:block;">
58                <div style="width:2000px;">&nbsp;</div>
59        </div>
60        <div id="s2" style="width:550px;height:550px;overflow:hidden;background-color:white;border:0px solid white;margin:0px;padding:0px;border-width:45px 35px 15px 25px;"
61                ><img src="../../../dojo/resources/blank.gif" style="border:1px solid black;height:111px;width:548px;display:block;" onclick="dojo.window.scrollIntoView(this)"
62                ><nobr id="p2" style="display:block;border:0px solid cyan;padding:0px;margin:0px;"
63                        ><img id="c2" src="../../../dojo/resources/blank.gif" style="height:548px;width:85px;display:inline;border:1px solid black;" onclick="dojo.window.scrollIntoView(this)"
64                        ><img id="q2" src="../../../dojo/resources/blank.gif" style="width:548px;height:548px;display:inline;border:1px solid black;" onclick="dojo.window.scrollIntoView(this)"
65                        ><img id="t2" src="../../../dojo/resources/blank.gif" style="height:548px;width:85px;display:inline;border:1px solid black;" onclick="dojo.window.scrollIntoView(this)"
66                ></nobr
67                ><img src="../../../dojo/resources/blank.gif" style="border:1px solid black;height:100px;width:498px;display:block;" onclick="dojo.window.scrollIntoView(this)"
68        ></div>
69        <img src="../../../dojo/resources/blank.gif" style="height:255px;width:1px;display:block;">
70        <div style="width:2222px;">&nbsp;</div>
71</body>
72</html>
Note: See TracBrowser for help on using the repository browser.