Re: How to tell if the page displayed in the Browser widget has scrolled

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: How to tell if the page displayed in the Browser widget has scrolled

Geoff Canyon via use-livecode
James.

You are looking for difficulties that are not present.

A. Do once:

A1. put into widget's or card's script
(this is a javaScriptHandler):

on jsNotify v
  put the seconds &": "& v into fld "info" -- or your action
end jsNotify

A2. From a button or msg (or use the property inspector):

put the javaScriptHandlers of widget "browser" into jsh
if jsh is not empty then put cr & "jsNotify" after jsh
else put "jsNotify" into jsh
set the javaScriptHandlers of widget "browser" to jsh

B. Do once for every new loaded page, no matter where from
(say http://livecode.com), for example from a button:

put "window.onscroll = function() { " & \
    "if (window.innerHeight + window.pageYOffset >= " & \
    "document.body.offsetHeight) " & \
    "liveCode.jsNotify('I am at the bottom'); };" into js
do js in widget "Browser"

Then scroll the browser widget to bottom and watch your field "info".

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: How to tell if the page displayed in the Browser widget has scrolled

Geoff Canyon via use-livecode
Hermann.... you are a rockstar.  I will use this method also. Thank you.

On Thu, Nov 8, 2018 at 10:55 AM, hh via use-livecode <
[hidden email]> wrote:

> James.
>
> You are looking for difficulties that are not present.
>
> A. Do once:
>
> A1. put into widget's or card's script
> (this is a javaScriptHandler):
>
> on jsNotify v
>   put the seconds &": "& v into fld "info" -- or your action
> end jsNotify
>
> A2. From a button or msg (or use the property inspector):
>
> put the javaScriptHandlers of widget "browser" into jsh
> if jsh is not empty then put cr & "jsNotify" after jsh
> else put "jsNotify" into jsh
> set the javaScriptHandlers of widget "browser" to jsh
>
> B. Do once for every new loaded page, no matter where from
> (say http://livecode.com), for example from a button:
>
> put "window.onscroll = function() { " & \
>     "if (window.innerHeight + window.pageYOffset >= " & \
>     "document.body.offsetHeight) " & \
>     "liveCode.jsNotify('I am at the bottom'); };" into js
> do js in widget "Browser"
>
> Then scroll the browser widget to bottom and watch your field "info".
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode