18
18
< body >
19
19
< div id ="visual-threshold "> </ div >
20
20
< h1 > This popup opens on exit intent (via embed code)</ h1 >
21
- < p > If a user wants to navigate away from your page, they usually need to access the browser toolbar.</ p >
22
- < p > We detect mouse movement in top part of the page - if the mouse is moving "up", we open the popup.</ p >
21
+ < p >
22
+ If a user wants to navigate away from your page, they usually need to
23
+ access the browser toolbar.
24
+ </ p >
25
+ < p >
26
+ We detect mouse movement in top part of the page - if the mouse is moving
27
+ "up", we open the popup.
28
+ </ p >
23
29
< p > The popup is opened only once (on first detected exit intent).</ p >
24
30
< button
25
31
id ="popup "
@@ -33,17 +39,32 @@ <h1>This popup opens on exit intent (via embed code)</h1>
33
39
</ button >
34
40
35
41
< h2 > Technical stuff</ h2 >
36
- < p > This is not available for customization on "Share" page, but the embed lib allows it.</ p >
42
+ < p >
43
+ This is not available for customization on "Share" page, but the embed lib
44
+ allows it.
45
+ </ p >
37
46
< form action ="" method ="get ">
38
47
< label for ="threshold "> Pixels from top</ label >
39
- < input id ="threshold " name ="threshold " type ="number " value ="50 " step ="10 " min ="10 " max ="250 " />
48
+ < input
49
+ id ="threshold "
50
+ name ="threshold "
51
+ type ="number "
52
+ value ="50 "
53
+ step ="10 "
54
+ min ="10 "
55
+ max ="250 "
56
+ />
40
57
< button type ="submit "> Set</ button >
41
58
</ form >
42
59
< script >
43
60
// if we want to modify embed code snippets we need to do it before loading embed-next.js
44
- const threshold = parseInt ( new URL ( window . location . href ) . searchParams . get ( 'threshold' ) , 10 )
61
+ const threshold = parseInt (
62
+ new URL ( window . location . href ) . searchParams . get ( 'threshold' ) ,
63
+ 10
64
+ )
45
65
if ( threshold ) {
46
- document . getElementById ( 'visual-threshold' ) . style . height = threshold + 'px'
66
+ document . getElementById ( 'visual-threshold' ) . style . height =
67
+ threshold + 'px'
47
68
document . getElementById ( 'popup' ) . dataset . tfOpenValue = threshold
48
69
document . getElementById ( 'threshold' ) . value = threshold
49
70
}
0 commit comments