Discussion:
How to tell if the page displayed in the Browser widget has scrolled
James Hale via use-livecode
2018-11-08 13:42:56 UTC
Permalink
Many thanks Hermann.

I can follow this (logic wise) as well as the forum links you provided.
But I didn't quite follow the implementation.
For now I will put it on the "it would be nice but not required" list, else I will not finish.

And yes, I will ask on the forum should I have a potentially long thread.
I have been on the use list since its inception in 2001 so it is automatically my first point of call.

James
hh via use-livecode
2018-11-08 15:55:56 UTC
Permalink
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".
Tom Glod via use-livecode
2018-11-08 16:35:46 UTC
Permalink
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 <
Post by hh via use-livecode
James.
You are looking for difficulties that are not present.
A1. put into widget's or card's script
on jsNotify v
put the seconds &": "& v into fld "info" -- or your action
end jsNotify
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
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
Please visit this url to subscribe, unsubscribe and manage your
http://lists.runrev.com/mailman/listinfo/use-livecode
Loading...