473,396 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

JavaScript problems

2
Hi All,
I use bellow code for Auto-Sizing Image Popup Window. It seems that it just stop working OK with IE7 as I didn't make any changes ... In the FF2.0 it still works great.
You can see the sample at :
http://www.delko.si/modelarstvo/traxxas/nitro/revo.htm

Thanks for your help !

I use the following code :
Expand|Select|Wrap|Line Numbers
  1. <script>
  2.  
  3. // SETUPS:
  4. // ===============================
  5.  
  6. // Set the horizontal and vertical position for the popup
  7.  
  8. PositionX = 100;
  9. PositionY = 100;
  10.  
  11. // Set these value approximately 20 pixels greater than the
  12. // size of the largest image to be used (needed for Netscape)
  13.  
  14. defaultWidth  = 800;
  15. defaultHeight = 800;
  16.  
  17. // Set autoclose true to have the window close automatically
  18. // Set autoclose false to allow multiple popup windows
  19.  
  20. var AutoClose = true;
  21.  
  22. // Do not edit below this line...
  23. // ================================
  24. if (parseInt(navigator.appVersion.charAt(0))>=4){
  25. var isNN=(navigator.appName=="Netscape")?1:0;
  26. var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
  27. var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
  28. var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
  29. function popImage(imageURL,imageTitle){
  30. if (isNN){imgWin=window.open('about:blank','',optNN);}
  31. if (isIE){imgWin=window.open('about:blank','',optIE);}
  32. with (imgWin.document){
  33. writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
  34. writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
  35. writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
  36. writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(100,100);');
  37. writeln('width=100-(document.body.clientWidth-document.images[0].width);');
  38. writeln('height=100-(document.body.clientHeight-document.images[0].height);');
  39. writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
  40. writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
  41. writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
  42. if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
  43. else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
  44. writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
  45. close();        
  46. }}
  47.  
  48. </script>
  49.  
Apr 3 '07 #1
2 1247

PositionX = 100;
PositionY = 100;

defaultWidth = 800;
defaultHeight = 800;

You will probably have to specifiy a unit for IE7. Try changing the above to this:
Expand|Select|Wrap|Line Numbers
  1.     PositionX = '100px';
  2.     PositionY = '100px';
  3.     defaultWidth = '800px';
  4.     defaultHeight = '800px';
  5.  

Hope this helps!

Regards,

]osh42O
Apr 3 '07 #2
suhy
2
You will probably have to specifiy a unit for IE7. Try changing the above to this:
Expand|Select|Wrap|Line Numbers
  1.     PositionX = '100px';
  2.     PositionY = '100px';
  3.     defaultWidth = '800px';
  4.     defaultHeight = '800px';
  5.  

Hope this helps!

Regards,

]osh42O
Unfortunately this doesn't make any change. The popup still doesn't resize to the righ dimmension in IE ...
Apr 4 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
93
by: lorlarz | last post by:
Here, let's see what you JavaScript programmers have got Here is a place to share your large or larger full-blown JavaScript applications: real.comp.lang.js.apps (a new google group) Here is...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.