• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Resize CFWindow when reloading

Guest
Jul 31, 2009 Jul 31, 2009

Copy link to clipboard

Copied

I have a 2 pages, the first is a thumbnail list page which creates a cfwindow of the second page (a large thumnail with the same images underneath it).

When I select one of the thumnails in the cfwindow, it refreshes the page, takes the url information and calls a query to retrieve the thumnails, and set the fullsize image to the one clicked.

Here is a cfwindow looks like to give you a better understanding

cfwindow_resize.gif

(please excuse the beautiful skinning I have done)..

My problem

My images are different sizes so I will need to resize the cfwindow everytime I reload it. I have tried these attempts

setContentSize() & resizeTo(). Now I am using this in my cfwindow, and when i created my cfwindow I called it 'fullimage' I would assume, that I could use 'this' or 'fullimage' as the name of my object.

<script language="JavaScript">
   resizeWindow = function(width,height){
      //Get window object  
     myWindow = ColdFusion.Window.getWindowObject(this);

     
      //use the setContentSize function to resize the window.      
      fullimage.setContentSize(width, height);
     
   }
</script>

And then on the body tag I do this

<body onload="resizeWindow('<cfoutput>#url.width#</cfoutput>',

'<cfoutput>#url.height#</cfoutput>')">

Views

1.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 01, 2009 Aug 01, 2009

Copy link to clipboard

Copied

Instead of reloading the window every time a thumbnail is clicked, why not load all the images into an array on the page load, then use Javascript to a) load the first image by default, and b) dynamically load the respective larger image when a thumb is clicked.  This way, you can get all the image dimensions at once and size the window for the largest one.  I believe DreamWeaver has a built-in template for pre-loading the images.

^_^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 02, 2009 Aug 02, 2009

Copy link to clipboard

Copied

LATEST

Yes, I quickly figured this out right after I posted, but I actually went further and created tooltips that have the fullsize image in it. its less hassle too. I would still like to find out how to reload a page that is in a cfwindow and resize the cfwindow itself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation