 |

ToddAndrae
User
Oct 3, 2003, 6:46 AM
Post #26 of 39
(6626 views)
Shortcut
|
|
Re: [Joey] Resize Window - fit to image
[In reply to]
|
Can't Post
|
|
you need to have the first page, the template page, with the script to add the images to the array. Without the array, the picture won't load and the description won't load. The page with the array script is named index.html in that zip I provided.
|
|
|  |
 |

Joey
User
Oct 4, 2003, 11:51 PM
Post #27 of 39
(6610 views)
Shortcut
|
|
Re: [ToddAndrae] Resize Window - fit to image
[In reply to]
|
Can't Post
|
|
<script><!-- var galleryArray = new Array(); var descriptionArray = new Array(); //add each image and description to the array as it loads //Works well for Dial-Up users, they can access the gallery //before all images load, and as they browse the images will //be added as they load. function addToGallery(imageURL, description){ //Removes _t denotation from thumbnail pictures //In the final version this will be replaced with // a detection script, in case it is an older version of // RM that does not use thumbnails. temp = imageURL.split('_t'); imageURL = temp[0] + temp[1]; i = galleryArray.length; galleryArray = imageURL; descriptionArray = description; } function imageWindow(sPicURL) { window.open("http://www.used-carlots.com/am/ templates/gallery/index.html?" + sPicURL, "imgWin", "width=400, height=300, top=40, left=40, status=yes, toolbar=no, menubar=no, location=no, resizable=yes"); }//--> </script> this is in the head of the template above.... and i tried it with window.open("gallery/index.html") also... This below is in the template to call in the pics <a href="$listing_url$/images/$file$"onMouseOver=" window.status='$lfield2$, $lfield1$ $lfield3$'; return true;"onMouseOut="defaultStatus=' ';"onClick="imageWindow( this.href); return false;"><img src="$listing_url$/images/ $file$" width="150" border="0" align="top" alt="$lfield2$, $lfield1$ $lfield3$"onload="addToGallery(this.src, this.alt);"> </a> and I have tried every possible changing of the url above..... heres my paths: gallery folder: used-carlots.com/am/exec/gallery templates: used-carlots.com/am/templates images: used-carlots.com/am/listings/images example of not working: http://www.used-carlots.com/am/exec/search.cgi?view=66&template=_publish_bargain_listing.html I placed your index.html (http://www.used-carlots.com/am/templates/index.html) with the property pics in my templates folder and it worked fine....but for some reason when the page loads for the AM template its not loading the images into an array to be carried OVER to gallery/index.html I would be totally indebted to anyone who can help with this problem, I am pulling what hair i have left out over here....lol Joey Stubblefield http://Used-CarLots.com Powered By Auto Manager! http://1000Cars.com Powered By Auto Manager! http://MeetingStreetMotors.com Powered By Used-CarLots.com Via Auto Manager!
(This post was edited by Joey on Oct 4, 2003, 11:54 PM)
|
|
|  |
 | |  |
 |

webby
User
Dec 9, 2003, 4:16 PM
Post #29 of 39
(6154 views)
Shortcut
|
|
Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
Hi all I would really appreciate if someone could point me into the right direction. I get the pop up and I can see the description in the broken link of the image, but no images. my settings are as follows: ==================================== urls : http://http//www.interealty.com.au http://http//www.interealty.com.au/templates/_publish_listings.html http://http//www.interealty.com.au/listings/gallery/gallery.html Search: http://www.interealty.com.au/exec/search.cgi ==================================== _publish_listings.html Page ================================= function imageWindow(sPicURL) { window.open("gallery/gallery.html?" + sPicURL, "imgWin", "width=400, height=300, top=40, left=40, status=no, toolbar=no, menubar=no, location=no, resizable=yes"); === ============================================ <a href="http://www.interealty.com.au/listings/images/$file$" onMouseOver="window.status='$desc$'; return true;" onMouseOut="defaultStatus=' ';" onClick="imageWindow(this.href); return false;"> <img src="http://www.interealty.com.au/listings/images/$file$" width="120" alt="$desc$" onLoad="addToGallery(this.src, this.alt);"/></a> $desc$ ====================================== Gallery index.html Page ======================================== } else{ top.location.href='http://www.interealty.com.au/'; } == ================================== I have tried every possible change and I can't work out what is wrong...the popup works fine but no images are displayed. I would be gratefull to anyone who can help with this problem (as i have a client breathing on my neck....lol !! ) Cheers Webby
|
|
|  |
 |

ToddAndrae
User
Dec 10, 2003, 6:47 AM
Post #30 of 39
(6143 views)
Shortcut
|
|
Re: [webby] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
Well when I looked at it, it said that window.opener.galleryArray is null or not an object. Change the area in there that says status=no to status=yes, this will let you see exactly what the problem is.
|
|
|  |
 |

webby
User
Dec 10, 2003, 1:39 PM
Post #31 of 39
(6130 views)
Shortcut
|
|
Re: [ToddAndrae] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
Hi Todd, Thanks for your reply, I changed the code (borrowed you new gallery window) and seems to work much better, however only the first picture is displayed. If you click on the controls, some work, some no and does't display the respective images (it does however show the $desc$ of each and the total number of pic's, but no image). http://www.interealty.com.au/listings/ Thank you Webby
|
|
|  |
 |

ToddAndrae
User
Dec 10, 2003, 2:56 PM
Post #32 of 39
(6124 views)
Shortcut
|
|
Re: [webby] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
Wow I completely forgot about something I added. If you aren't using the thumbnail feature in RM/LM take out the: temp = imageURL.split('_t'); imageURL = temp[0] + temp[1]; if you don't remove this it adds an 'undefined' to the end of the URL string and it will not correctly find the image. If you take that out it should work like a charm.
(This post was edited by ToddAndrae on Dec 10, 2003, 3:25 PM)
|
|
|  |
 |

webby
User
Dec 10, 2003, 4:52 PM
Post #33 of 39
(6116 views)
Shortcut
|
|
Re: [ToddAndrae] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
Got it...but i do not know what line to change on the array on the _publish_listing.html. (that is where you define the array ?)
|
|
|  |
 |

ToddAndrae
User
Dec 10, 2003, 6:40 PM
Post #34 of 39
(6111 views)
Shortcut
|
|
Re: [webby] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
in _publish_listing.html find the following lines of code and remove the bolded section: temp = imageURL.split('_t'); imageURL = temp[0] + temp[1]; i = galleryArray.length; galleryArray = imageURL; descriptionArray = description;
|
|
|  |
 |

webby
User
Dec 11, 2003, 12:16 AM
Post #35 of 39
(6103 views)
Shortcut
|
|
Re: [ToddAndrae] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
  Great !!! . . working fine now! Thank you for your help. I would make a clean copy later with all the changes in case someone needs it. Cheers Webby
|
|
|  |
 |

ToddAndrae
User
Apr 23, 2004, 7:07 AM
Post #36 of 39
(5657 views)
Shortcut
|
|
Re: [ToddAndrae] Resize Window - So close yet so far.....
[In reply to]
|
Can't Post
|
|
an update on the script. It will now detect if you are using thumbnails or not.
<script><!-- var galleryArray = new Array(); var descriptionArray = new Array(); function addToGallery(imageURL, description){ var thumbnailFilter = /_t/i; if (thumbnailFilter.test(imageURL)){ temp = imageURL.split('_t'); imageURL = temp[0] + temp[1]; } i = galleryArray.length; galleryArray = imageURL; descriptionArray = description; } function imageWindow(sPicURL) { window.open("gallery/index.html?" + sPicURL, "imgWin", "width=400, height=300, top=40, left=40, status=yes, toolbar=no, menubar=no, location=no, resizable=yes"); }//--> </script> and a refresher, make the links to the images as such
<a href="http://www.domainname.com/path/to/lm/images/$file$" onMouseOver="window.status='$desc$'; return true;" onMouseOut="defaultStatus=' ';" onClick="imageWindow(this.href); return false;"><img src="http://www.domainname.com/path/to/lm/images/$file$" width="150" border="0" alt="$desc$" onLoad="addToGallery(this.src, this.alt);"></a> and finally the gallery(gallery/index.html)
<html> <head> <title>Loading...</title> <script language="javascript"> var temp=self.location.href.split("?"); var picUrl = (temp.length>1)?temp[1]:""; var NS = (navigator.appName=="Netscape")?true:false; function firstPic(){ document.getElementById('picture').src = window.opener.galleryArray[0]; document.getElementById('picture').alt = window.opener.descriptionArray[0]; document.title = window.opener.descriptionArray[0]; var description = new String(); description = window.opener.descriptionArray[0]; description += ' 1/' + window.opener.descriptionArray.length; document.getElementById('description').innerHTML = description; } function previousPic(){ picUrl = document.getElementById('picture').src; var i=0; if(picUrl!=window.opener.galleryArray[0]){ while(i<=window.opener.galleryArray.length){ if(picUrl==window.opener.galleryArray){ document.title = window.opener.descriptionArray[i-1]; var description = new String(); var count = i; description = window.opener.descriptionArray[i-1]; description += ' ' + count + '/' + window.opener.descriptionArray.length; document.getElementById('description').innerHTML = description; document.getElementById('picture').src = window.opener.galleryArray[i-1]; document.getElementById('picture').alt = window.opener.descriptionArray[i-1]; i = window.opener.galleryArray.length; } else{ i++; } } } } function nextPic(){ picUrl = document.getElementById('picture').src; var i=0; if(picUrl!=window.opener.galleryArray[window.opener.galleryArray.length-1]){ while(i<=window.opener.galleryArray.length){ if(picUrl==window.opener.galleryArray){ document.title = window.opener.descriptionArray[i+1]; var description = new String(); var count = i + 2; description = window.opener.descriptionArray[i+1]; description += ' ' + count + '/' + window.opener.descriptionArray.length; document.getElementById('description').innerHTML = description; document.getElementById('picture').src = window.opener.galleryArray[i+1]; document.getElementById('picture').alt = window.opener.descriptionArray[i+1]; i = window.opener.galleryArray.length; } else{ i++; } } } } function lastPic(){ document.getElementById('picture').src = window.opener.galleryArray[window.opener.galleryArray.length-1]; document.getElementById('picture').alt = window.opener.descriptionArray[window.opener.galleryArray.length-1]; document.getElementById('description').innerText = window.opener.descriptionArray[window.opener.descriptionArray.length-1]; var description = new String(); description = window.opener.descriptionArray[window.opener.descriptionArray.length-1]; description += ' ' + window.opener.descriptionArray.length + '/' + window.opener.descriptionArray.length; document.getElementById('description').innerHTML = description; } function firstTime(){ picUrl = document.getElementById('picture').src; var i = 0; while(i<=window.opener.galleryArray.length){ if(picUrl==window.opener.galleryArray){ document.title = window.opener.descriptionArray; var description = new String(); var count = i + 1; description = window.opener.descriptionArray; description += ' ' + count + '/' + window.opener.descriptionArray.length; document.getElementById('description').innerHTML = description; document.getElementById('picture').alt = window.opener.descriptionArray; i = window.opener.descriptionArray.length; } else{ i++; } } } function fitPic(){ iWidth = (NS)?window.innerWidth:document.body.clientWidth; iHeight = (NS)?window.innerHeight:document.body.clientHeight; iWidth = document.getElementById('picture').width - iWidth; iHeight = document.getElementById('picture').height - iHeight + 20; window.resizeBy(iWidth, iHeight-1); self.focus(); }; </script> </head> <body style="margin: 0px; padding: 0px;" onLoad="firstTime();"> <script language="javascript"> document.write('<img id="picture" src="'+picUrl+'" onload="fitPic();" alt=""><table cellpadding="0" cellspacing="0" width="100%" style="background-color: #008BFF;">'); </script> <tr> <td width="22"><a href="#" onclick="firstPic(); return false;"><img src="images/first.jpg" alt="First Picture" width="22" height="20" border="0"></a></td> <td width="20"><a href="#" onclick="previousPic(); return false;"><img src="images/previous.jpg" alt="Previous Picture" width="20" border="0"></a></td> <td style="background-color: #008BFF; color: #000620;"><span id="description" style="font-family: sans-serif; font-size: 10pt;">Loading... </span></td> <td width="20"><a href="#" onclick="nextPic(); return false;"><img src="images/next.jpg" alt="Next Picture" border="0"></a></td> <td width="22"><a href="#" onclick="lastPic(); return false;"><img src="images/last.jpg" alt="Last Picture" border="0"></a></td> </tr> </table> </body> </html> Thanks to makeitREal for getting me to look at the script again. It also looks like it sizes correctly in newer versions of Mozilla and Firefox.
|
|
|  |
 | |  |
 |

Datahouse
User
Apr 26, 2004, 7:01 AM
Post #38 of 39
(5604 views)
Shortcut
|
|
Re: [ToddAndrae] Resize Window - fit to image
[In reply to]
|
Can't Post
|
|
Hi Todd, I did use your code to open the images in a popup resized window, and this works fine. However: your example shows all the pictures in one window, with the possibilit to go from the first to the last, and that is what I am missing. Can you help me out to get that last part there? You can see it at : http://www.datahouse.be/base/listings/l0001.html Thanks a lot in front and afterwards
|
|
|  |
 |

ToddAndrae
User
Apr 26, 2004, 7:25 AM
Post #39 of 39
(5603 views)
Shortcut
|
|
Re: [Datahouse] Resize Window - fit to image
[In reply to]
|
Can't Post
|
|
You are actually using the old files. I have attached, or atleast I hope I did, a zip of the updated files The directory 'gallery' goes in your root directory. and be sure to change the following line in the file \gallery\index.html else{ top.location.href='http://www.kpdk.com/'; } to your domain name.
|
|
Attachments:
|
popUp.zip
(158 KB)
|
|
|  |
|