matrix2223 Posted March 21, 2006 Posted March 21, 2006 This is what I am trying to do I am trying to center the popup image when it pops up I have the fallowing contribs installed popup_image1_2_3_4_5_6_7_8_9_10_11_12 more pics 6 here is the code I have for resizing function resize() { <?php // BOF: More Pics 6 ?> if (document.layers) i=40; if (document.images[0]) window.resizeTo(document.images[0].width +45, document.images[0].height+135-i); <?php // EOF: More Pics 6 ?> self.focus(); } I tried different ways and even a else if statement Any help will be appri. Thanks
Guest Posted March 21, 2006 Posted March 21, 2006 anyone have an idea Don't keep bumping your post like this - we heard the first time! Getting popup images to work on all browsers is a real black art. I got it working but only after a lot of head-scratching. I suggest you try your friendly google; there are a few examples out there for how to achieve this. I think the best (ie - will work on most browsers) solutions involve using javascript (that's what I did in the end anyway). I'm afraid it's something that ought to be really easy but it's actually really fiddly to do. I don't know if any of the OSC contributions do this well / reliably or not. Rich.
custodian Posted March 21, 2006 Posted March 21, 2006 Are you trying to center the image in the window? Or center the window itself (so when it pops up on the screen it is dead center of the screen) My Contributions Henry Smith
custodian Posted March 21, 2006 Posted March 21, 2006 Are you trying to center the image in the window? Or center the window itself (so when it pops up on the screen it is dead center of the screen) This should work http://www.oscommerce.com/community/contri...ry/search,97703 But I see you have other contrib's installed. You may need to modify this using you current contrib. My Contributions Henry Smith
matrix2223 Posted March 21, 2006 Author Posted March 21, 2006 I would like it to be in the dead center of the screen if possible some images are big and you have to drag it up to see the whole box.
matrix2223 Posted March 21, 2006 Author Posted March 21, 2006 I have your contrib already along with more pics 6 and put both together
custodian Posted March 21, 2006 Posted March 21, 2006 If your images are various size, instead of centering them, put them to the top left corner and give them whatever room they need to grow. edit /catalog/product_info.php Find the line that says function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhi story=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150') The screenX=150,screenY=150,top=150,left=150 controls the positioning of the window Changing it to something like screenX=0,screenY=0,top=0,left=0 will position the window at the absolute top left corner. From there, play with the numbers to your liking. My Contributions Henry Smith
custodian Posted March 21, 2006 Posted March 21, 2006 Here is some other information Have you noticed that pop-up windows can pop up anywhere on the browser page? Yes, you can control the placement of a pop-up window by adding more commands to the JavaScript string. However, these will only work with Netscape Navigator 4.x and newer or Microsoft Internet Explorer 4.x and newer. If a visitor is using an earlier version of either browser, it will ignore the placement values. With Netscape browsers, screenX and screenY attributes control placement. These values are used to place a pop-up window relative to the left and top edges of the user's monitor and are expressed in pixels. In IE browsers, left and top attributes control placement of the pop-up window relative to the top and upper left corner of the user's monitor. Values are in terms of pixels. Combine the screenX, screenY, top, and left attributes and values to ensure correct placement in both browsers. Screen placement values are placed in the JavaScript string according to which section controls browser appearance. The following placement values will force the pop-up window to display in the center of the browser window: window.open('child.htm', 'newWindow','width=200,height=200, screenX=400,screenY=400,top=400, left=400' credits go to Smart Computing NOTE: that says the center of the browsers window, not the computer screen. My Contributions Henry Smith
matrix2223 Posted March 21, 2006 Author Posted March 21, 2006 Hey thanks custodian, I also wanted to say thanks for the contrib you did with the auto resize I added that with the more pics 6 and with both together it is great. Thanks for all of your help
custodian Posted March 21, 2006 Posted March 21, 2006 Hey thanks custodian, I also wanted to say thanks for the contrib you did with the auto resize I added that with the more pics 6 and with both together it is great. Thanks for all of your help No problem, glad to help My Contributions Henry Smith
Recommended Posts
Archived
This topic is now archived and is closed to further replies.