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

hh hh at hyperhh.de
Thu Nov 8 10:55:56 EST 2018


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".




More information about the use-livecode mailing list