PDA

View Full Version : Problem with repeat region and pre-loading images


kiqyou
04-14-2007, 11:45 PM
Has anyone ran into trouble with pre-loading images and repeat region? I'm generating a 5 dynamic thumbs in a repeat region but the pre-load image won't work so when you mouse over it changes a target <img> w/o loading. Any help would be great. Thanks.

davidj
04-15-2007, 10:11 AM
post the code

chriskq
04-15-2007, 10:12 AM
what are you trying to acheive?
rollovers for a nav, a image gallery type of thing, or a disjointed type of rollover

is ur page online anywhere too?

kiqyou
04-15-2007, 03:56 PM
I got to thinking. It's a problem with pre-loading an image with a dynamically generated reference. I don't think it likes this:


onmouseover="MM_swapImage('selected_pic','','pt/phpThumb.php?src=../media/<?php echo $row_account_info['id']; ?>/photos/<?php echo $row_four_Photos['filename']; ?>&amp;w=150&amp;h=150&amp;ar=x&amp;fltr[]=usm|80|0.5|3&amp;zc=1',1)"



this is the rest of it:

//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}
//]]>
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}



<?php do { ?>
<td width="39" valign="top"><img src="pt/phpThumb.php?src=../media/<?php echo $row_account_info['id']; ?>/photos/<?php echo $row_four_Photos['filename']; ?>&amp;w=46&amp;h=46&amp;ar=x&amp;zc=1" alt="" width="25" hspace="1" vspace="1" border="1" class="display_hand" onmouseover="MM_swapImage('selected_pic','','pt/phpThumb.php?src=../media/<?php echo $row_account_info['id']; ?>/photos/<?php echo $row_four_Photos['filename']; ?>&amp;w=150&amp;h=150&amp;ar=x&amp;fltr[]=usm|80|0.5|3&amp;zc=1',1)"/>
<?php } while ($row_four_Photos = mysql_fetch_assoc($four_Photos)); ?>

davidj
04-15-2007, 05:43 PM
your onmouseover function

you have this...

onmouseover="MM_swapImage('selected_pic','','pt/phpThumb.php?src=../media/<?php echo $row_account_info['id']; ?>/photos/<?php echo $row_four_Photos['filename']; ?>&amp;w=150&amp;h=150&amp;ar=x&amp;fltr[]=usm|80|0.5|3&amp;zc=1',1)"

please note the &amp you have which is in your dynamic query string

you need to replace these with an &

kiqyou
04-16-2007, 06:20 PM
it doesn't work without &amp. a single & breaks it.

kiqyou
04-16-2007, 06:38 PM
what are you trying to acheive?
rollovers for a nav, a image gallery type of thing, or a disjointed type of rollover

is ur page online anywhere too?


I'm looking for a photo gallery like this: http://www.amazon.com/gp/product/B000CRZCPO/ref=noref/103-4914829-1430213?ie=UTF8&s=photo

...with the exception of the load time required during onmouseover.

kiqyou
04-19-2007, 05:25 PM
nothing? ....