iscroll4 - How do I make iScroll5 work when the image is generated from a DB? -


I am using iScroll5 in a phonegap project. On the index page, the user will click on a series of thumbnails generated from a database, then the selected image ID will be written in the locale, the page will change, the image ID will be dragged from the localized stubs and the image will be displayed.

This works fine if I directly reference the image (not to DB) in this way (as a test):

   

I can pin / zoom to resize the image for the screen (my app's main function is required), and scroll on the image X and Y axis, then the image Tap on the index page to come back. All this works

But if I drag the image out of the database and reference it in the following way, then all other aspects of the page code are the same, do not work pinch / zoom, though The picture is displayed and I can scroll on X and Y:

  // ... here DB code ... function querySwashwas (tx, result) {var path = results .rows.item.category + "/" + Results.rows.item.subcat + "/" + results.rows.item.filename_lg; Document.getElementById ("Output"). InnerHTML = "& lt; img src = '" + path + "'>"; }  

// ... more DB code here ...

   

How can iScroll5 work when the image is generated from DB? I am using the same CSS and iScroll JS on both pages (IScroll4 has the same problem as iScroll 5 above.) I'm using the SQLite DB plugin (from which I have my own site).

To call it refresh on the scrollbar to identify the DOM change Try it.

It is 0-delay setTimeout , such as (stolen from):

setTimeout (function () {myScroll.refresh ();} , 0);

If the image takes time to load, you will want to wait until it is fully loaded, as long as you do not know the dimensions up-front.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -