Email conversation
From | Stewart X8 |
To | Me |
Subject | Resizing a popup image problem! |
Date | 31 August 2008 21:34 |
Mark, I will try to come to the point as clearly as possible:
I'm new to the field of html/JavaScript code (just a web designer).
I use IE7 on vista and am having a problem related to a
JavaScript via "Auto-Sizing Image Popup Window Script":
http://www.howtocreate.co.uk/perfectPopups.html
related JavaScript: Resizing a popup to perfectly fit an image
I upload it to my url here [URL]
(please check tumbnails for larger images)
It sort of works ok but there at the bottom their some exta vertical high!
I need a more perfect vertical fit.
Can you help me, I would be very greatful for your time. thanks
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 12:07 |
Mark, just to let you know I sort-of fixed the problem.
What I need help is to remove the url and state bar on the top/bottom popup
window.
can this be do, if yes what changes to the code will I make.
Also I test my site offline and I get a windows message for the site page
and the popup window (below).
I changed the "interest optains/custom" to "enable" but it's still their,
how can I get rud of this!
*"To help protect your security, Internet explorer has restricted this
webpage from running scripts or ActiveX controls that could access your
computer. Click here for options".*
thanks again
From | Me |
To | Stewart X8 |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 15:00 |
Stewart,
> What I need help is to remove the url and state bar on the top/bottom popup
> window.
For security reasons, most browsers will not allow you to completely remove
the address bar. IE also extends that to the status bar. Web pages cannot
remove them.
> *"To help protect your security, Internet explorer has restricted this
> webpage from running scripts or ActiveX controls that could access your
> computer. Click here for options".*
IE disables scripting in local files by default - I assume the fix on Vista
is the same as on previous Windows versions:
http://www.howtocreate.co.uk/emails/RussellDiehl.html
http://www.howtocreate.co.uk/emails/JonMychaelBest.html
Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 18:32 |
Attachment | screenshot of a failed resize |
Tarquin, thanks for your fast reply which I foundextremely helpful.
I edited the IE settings:
*Tools - Internet Options - Advanced - Security; "Allow active content to
run
in files on My Computer"*
When viewed offline the information security bar in go great;)
but now the "auto-resize popup window script" funtion sometimes does not
work! (see attachment)
what part of the code do I need to change to fix this!
thanks again for your help, stew
From | Me |
To | Stewart X8 |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 18:47 |
Stewart,
> but now the "auto-resize popup window script" funtion sometimes does not
> work!
No idea what could cause this. So long as it works online, I'd just ignore
it. IE's hopeless mistake-of-a-security restriction is a joke. You can't
expect it to make sense.
Tarquin
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 18:49 |
ok I got it working now.
no need to help me...
thanks again stew
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 18:50 |
Tarquin, ok I got it working now thanks
stew
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 19:51 |
Tarquin, I got a test page up and running but as you can see the two last
ones do not work correctly!
I need the hold image to shown, ever if its off screen. again is this
possible...
[URL]
thanks
From | Me |
To | Stewart X8 |
Subject | Re: Resizing a popup image problem! |
Date | 1 September 2008 20:20 |
Stewart,
> Tarquin, I got a test page up and running but as you can see the two last
> ones do not work correctly!
The images are too big for the script to resize the popups correctly, given
the size of your screen. The version of the script that you are using cannot
cope with that. Please read the script details page carefully, it has
extensive details of this problem, and several ways to cope with this
situation. There is even a special version of the script designed exactly
for this problem. Please also search through my existing mails, since I have
gone over this problem with other people many times.
Tarquin
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 2 September 2008 12:27 |
Attachment | screenshot of the popup code... |
Tarquin, I have find/read the part which deals with cope with this situation
(add scrollbars) "Preventing the popups from becoming larger than the
screen"
but it still does not work (see attachment code). As I am only a web
designer how can I add scrollbars to all/large images...
thanks again for your time.
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 2 September 2008 12:51 |
Attachment | screenshot of the popup code... |
sorry I find a double repeat in the last code here is the new cold which
does not work:
//don't touch
function popImage(imageURL,imageTitle){
var imgWin =
window.open('','_blank','scrollbars=no,resizable=1,width='+defaultWidth+
',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
if( !imgWin ) { return true; } //popup blockers should not cause errors
imgWin.document.write('[...]\n'+
'var x =
window.open('','windowName','width=500,height=400,resizable=1,scrollbars=1'
);\n'+
'var mH = screen.availHeight-200, mW = screen.availWidth-200;\n'+
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 2 September 2008 12:53 |
Tarquin is this the way their should to placed! sorry again for bugging
you...
'var x =
window.open('','windowName','width=500,height=400,resizable=1,scrollbars=1'
);\n'+
'var mH = screen.availHeight-200, mW = screen.availWidth-200;\n'+
'if( oH > mH ) { oH = mH; }\n'+
'if( oW > mW ) { oW = mW; }\n'+
kind regards
From | Me |
To | Stewart X8 |
Subject | Re: Resizing a popup image problem! |
Date | 2 September 2008 16:29 |
> window.open('','windowName','width=500,height=400,resizable=1,scrollbars=1'
> );\n'+
You were supposed to modify the existing window.open command, not create a
new one. This will break everything. I have made a small clarification to
the article, but using window.open is one of the most basic things that can
be done with JavaScript, so if you are unable to follow the article, I
suggest you take some time to learn JavaScript. If you are going to use it
on your pages, you really should learn how it works, because otherwise you
will be completely dependent on other people like me to be your constant
support, and you simply can't rely on that.
I have a tutorial that should help you get started:
http://www.howtocreate.co.uk/tutorials/javascript/important
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 2 September 2008 21:01 |
Tarquin, I changed the scrollbars=1 and it works abit thx
but I just can not understand where to place your code strings for in my
code (below)!
*var imgWin =
window.open('','_blank','scrollbars=1,resizable=1,width='+defaultWidth+',
height='+defaultHeight+',left='+PositionX+',top='+PositionY);
*
*x.resizeTo( oW + 200, oH + 200 );*
*'var mH = screen.availHeight-50, mW = screen.availWidth-40;\n'+
'if( oH > mH ) { oH = mH; }\n'+
'if( oW > mW ) { oW = mW; }\n'+*
once I know where to place them 'that it' will ever use JavaScript again
ever. I really do not what to spend months trying to find out as its not my
field and I just need a little help which you have given me so far....thanks
my code used so far:
[code for a basic image perfect popup]
From | Me |
To | Stewart X8 |
Subject | Re: Resizing a popup image problem! |
Date | 2 September 2008 22:41 |
> I just can not understand where to place your code strings for in my code
> (below)!
>
> var imgWin = window.open('','_blank','scrollbars=1,resizable=1,width='+
> defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+
> PositionY);
It's already in the right place.
> x.resizeTo( oW + 200, oH + 200 );
It's already in the right place.
> 'var mH = screen.availHeight-50, mW = screen.availWidth-40;\n'+
> 'if( oH > mH ) { oH = mH; }\n'+
> 'if( oW > mW ) { oW = mW; }\n'+
Insert it immediately before this line:
> 'var x = window; x.resizeTo( oW + 200, oH + 200 );\n'+
And remember to tweak the numbers (currently 50 and 40) to make sure the
effect works perfectly.
From | Stewart X8 |
To | Me |
Subject | Re: Resizing a popup image problem! |
Date | 3 September 2008 12:56 |
Tarquin, it all seems to work now with scrollbars in IE & firefox online and
offline:)
thanks for you much needs help, will refer your amazing site to all my
workers.
kind regards
From | Stewart X8 |
To | Me |
Subject | Perfect Popups Question! |
Date | 19 September 2008 21:30 |
Dear Tarquin,
I am trying to resize a popup to fit image AND content ([brand] movie)
Can this be do! could I click on a tumbnail which popup to a full image and
then
in the same page click on a other tumbnail which popup to a floating [brand]
movie window!
I have read the text you write on this topic at the end of your "Perfect
Popups" page.
But as a non-programmer can not understand how to create such a script.
Could you help me out and visit this test page I uploaded for you online
[URL]
which changes should I make to your code...again your help is much needed
here.
many thanks, stew...
From | Me |
To | Stewart X8 |
Subject | Re: Perfect Popups Question! |
Date | 25 September 2008 23:13 |
Stew,
> I am trying to resize a popup to fit image AND content ([brand] movie)
The script is not designed for this, but it's not impossible. It's best to
use a static HTML page for the plugin content, and make sure you know the
exact size that the layout will need (so you need to know the dimensions of
the image and the plugin, inside your layout.
Put it all inside a div, absolutely positioned, with height and width set to
the exact size it will need.
Use the version of the script in the section "Resizing the inside of the
current window" (make sure you copy the getRefToDivMod function from the
earlier section too). I guess you don't want to wait until onload fires
before resizing, since that's quite slow when plugins are involved. However,
since the size of the div is static, it's easy enough to just call the
resizeWinTo function just before the </body>
Then all you have to do is open that page in a popup.
Hope this is enough for you to get it working. I am not going to be able to
read mail or reply for quite a while.
From | Stewart X8 |
To | Me |
Subject | Re: Perfect Popups Question! |
Date | 26 September 2008 09:26 |
thanks great help