@@ -21,30 +21,44 @@ public function topStart(string|array|null $options, int $order = 0): static
2121 return $ this ->top ($ options , $ order , 'Start ' );
2222 }
2323
24+ public function top (array |string |null $ options , ?int $ order = null , ?string $ position = null ): static
25+ {
26+ if ($ order > 0 ) {
27+ $ this ->attributes ["top {$ order }{$ position }" ] = $ options ;
28+ } else {
29+ $ this ->attributes ["top {$ position }" ] = $ options ;
30+ }
31+
32+ return $ this ;
33+ }
34+
2435 public function topEnd (string |array |null $ options , int $ order = 0 ): static
2536 {
2637 return $ this ->top ($ options , $ order , 'End ' );
2738 }
2839
29- public function bottomStart (string | array | null $ options , int $ order = 0 ): static
40+ public function topEndView (string $ selector , int $ order = 0 ): static
3041 {
31- return $ this ->bottom ( $ options , $ order , 'Start ' );
42+ return $ this ->topView ( $ selector , $ order , 'End ' );
3243 }
3344
34- public function bottomEnd (string | array | null $ options , int $ order = 0 ): static
45+ public function topView (string $ selector , int $ order = 0 , ? string $ position = null ): static
3546 {
36- return $ this ->bottom ($ options , $ order , 'End ' );
47+ $ script = "function() { return $(' {$ selector }').html(); } " ;
48+
49+ return $ this ->top ($ script , $ order , $ position );
3750 }
3851
39- public function top ( array | string | null $ options , ? int $ order = null , ? string $ position = null ): static
52+ public function bottomStartView ( string $ selector , int $ order = 0 ): static
4053 {
41- if ($ order > 0 ) {
42- $ this ->attributes ["top {$ order }{$ position }" ] = $ options ;
43- } else {
44- $ this ->attributes ["top {$ position }" ] = $ options ;
45- }
54+ return $ this ->bottomView ($ selector , $ order , 'Start ' );
55+ }
4656
47- return $ this ;
57+ public function bottomView (string $ selector , int $ order = 0 , ?string $ position = null ): static
58+ {
59+ $ script = "function() { return $(' {$ selector }').html(); } " ;
60+
61+ return $ this ->bottom ($ script , $ order , $ position );
4862 }
4963
5064 public function bottom (array |string |null $ options , ?int $ order = null , ?string $ position = null ): static
@@ -57,4 +71,24 @@ public function bottom(array|string|null $options, ?int $order = null, ?string $
5771
5872 return $ this ;
5973 }
74+
75+ public function bottomEndView (string $ selector , int $ order = 0 ): static
76+ {
77+ return $ this ->bottomView ($ selector , $ order , 'End ' );
78+ }
79+
80+ public function topStartView (string $ selector , int $ order = 0 ): static
81+ {
82+ return $ this ->topView ($ selector , $ order , 'Start ' );
83+ }
84+
85+ public function bottomStart (string |array |null $ options , int $ order = 0 ): static
86+ {
87+ return $ this ->bottom ($ options , $ order , 'Start ' );
88+ }
89+
90+ public function bottomEnd (string |array |null $ options , int $ order = 0 ): static
91+ {
92+ return $ this ->bottom ($ options , $ order , 'End ' );
93+ }
6094}
0 commit comments