| dhteumeuleu forums / English / ImageFlow - reinvoke imf.create |
| Author | Message |
| azez Member |
# Posted: 25 Jun 2008 00:14 hello i have used the Ajax version and worked perfectly ( the demo as is ). then, trying to re-invoke imf.create() with a different xml file to read from and update the current display.. nothing happens. my last try was to start the page empty, and invoke the imf.create() manually (using firefox js console) instead of putting in the code.. nothing happens is there a way to pop() current images and push() images from the second xml file.. or is the second invoke imf.create() supposed to refill the display? thx |
| azez Member |
# Posted: 25 Jun 2008 00:19 edit: i mentioned above: different xml actually it is 2nd xml with different images and is working fine. now i have image-flow.xml image-flow1.xml image-flow2.xml the question is regarding to retrieving the new images and reloading only. having three links so the user can choose which gallery to show, and onclick=imf.creat( galler_id ) should update the gallery..but nothing happens. sorry if it is not clear . |
| azez Member |
# Posted: 25 Jun 2008 23:59 i have added this code to the javascript in oder to 1- null current instance. 2- fill instance with images from xml file. it should be exactly after the create method inside return().
,
remove: function(){
alert( instances.length);
instances.pop();
},
refill: function(div, xmlfile, horizon, size, zoom, border, sta now trying to inspect the DOM object to read the images .. i found it to be JSON like but not really a JSON object: using 3 images:
#1={
diapos:
[
#2=
{
parent:#1#,
loaded:false,
title:"Nothing",
text:"...can come between us",
url:false,
target:"_self",
N:0,
img:{},
x0:516,
x1:516,
w0:0,
w1:0,
z1:1,
z2:0
},
#3={parent:#1#, loaded:false, title:"Much work", text{ : if i try to reach imf.instances[0].diapos['#2'] or imf.instances[0].diapos[0] i get instances[0] has no properties. someone asked how to clear the stack of images, and no reply yet. i would appreciate if there is some clues how to finish this project and have it serving more people with refill. thx |
| azez Member |
# Posted: 27 Jun 2008 18:56 i have found the answer. having more than one gallery, where each has its own xml file.. in index.htm
function cg( id )
{
// remove current album
imf.remove();
// fill new album
imf.refill("imageFlow", 'image-flow' + id + '.xml', 0.75, 0.15, 1.8, then links that call the above function <a href="#" onclick="cg(1)"> 1 </a><br> <a href="#" onclick="cg(2)"> 2 </a> ------------------------- in the imf javascript, i changed the return to the following: return {
/* ==== initialize script ==== */
create : function (div, xmlfile, horizon, size, zoom, border, s ----------------- also, i added a line to assign a class name to the canvas of images (reflections) : line#47: this for firefox like: flx.setAttribute("class", "Canvas"); line# 58: for ie: flx.setAttribute("className", "Canvas"); and it should be working fine
thanks for sharing this script. cheers |
| bobo Member |
# Posted: 14 Jul 2009 17:54 azez, i've tried your code but it only draws a new instance over a previous one and doesn't remove the old one any ideas? |
| bobo Member |
# Posted: 14 Jul 2009 22:07 solved! flx.setAttribute("class", "canvas"); not flx.setAttribute("class", "Canvas"); |
| Albyung Member |
# Posted: 11 Aug 2009 16:52 Thanks azez, you make my day!!! |
|
Powered by miniBB forum software © 2001-2009 |