DarkSoul520 Posted February 23, 2006 Share Posted February 23, 2006 Ok, I have everything done with my popups, but theres one problemWhen I link to an image using a popup, there are huge margins on the top and left of the image on the pop up.How do I get rid of this? Link to comment Share on other sites More sharing options...
sbrownii Posted February 23, 2006 Share Posted February 23, 2006 Is this post continued from somewhere else? I'm totally lost!A link to the code in action(helpful), posting the actual code (not as helpful) or important parts (helpful when combined with link to working pages) would be nice.In general you can affect margins using css attribute called... hey, what do ya know... marginLook in the css reference or tutorials for more.Until I know more what you are talking about I can't be much help... Link to comment Share on other sites More sharing options...
DarkSoul520 Posted June 7, 2006 Author Share Posted June 7, 2006 God, I am really sorry for replying so late. I forgot I had the link to this site. I have huge white margins on the top, bottom, left, and right of my image I am linking too.Heres my coding.In Heading <script language="JavaScript">function openNewWindow(URLtoOpen, windowName, windowFeatures) {newWindow=window.open(URLtoOpen, windowName, windowFeatures);} And this in the body <a href="javascriptopenNewWindow('http://i21.photobucket.com/albums/b285/DarkSoul520/Current%20Pics/2006/4_18_06.jpg','4_18_06','height=446,width=576,toolb ar=no,scrollbars=no,margin=0')"><img src="http://i21.photobucket.com/albums/b285/DarkSoul520/Current%20Pics%20Preview/2006/4_18_06.png" alt="" height="74" width="81" border="0"></a> Link to comment Share on other sites More sharing options...
asylum Posted June 7, 2006 Share Posted June 7, 2006 I struggled with this problem for a long time a while ago and decided I wasn't going to make an html page for each window so I just made one html page with a blank img tag and every time I opened that html page in the window and substituted the blank img tag for whatever src image I wanted. Try that. Link to comment Share on other sites More sharing options...
Jack McKalling Posted June 7, 2006 Share Posted June 7, 2006 <a href="javascript:openNewWindow('http://i21.photobucket.com/albums/b285/DarkSoul520/Current%20Pics/2006/4_18_06.jpg','4_18_06','height=446,width=576,toolb ar=no,scrollbars=no,margin=0')"><img src="http://i21.photobucket.com/albums/b285/DarkSoul520/Current%20Pics%20Preview/2006/4_18_06.png" alt="" height="74" width="81" border="0"></a>You forgot the colon sign after the java script: Link to comment Share on other sites More sharing options...
scott100 Posted June 7, 2006 Share Posted June 7, 2006 When I link to an image using a popup, there are huge margins on the top and left of the image on the pop up.How do I get rid of this?This is a css problem, so basically your going to have to write some style properties to the new window along with your picture, namely margin:0px.This should do the job <script language="JavaScript">function openNewWindow(URLtoOpen, windowName, windowFeatures) {newWindow=window.open("", windowName, windowFeatures);contents="<body style='margin:0px;'><img src='"+URLtoOpen+"' /></body>";newWindow.document.write(contents); }</script> Link to comment Share on other sites More sharing options...
MrAdam Posted June 7, 2006 Share Posted June 7, 2006 that doesn't work for me ^ .. here what i have: function launchImage() { var url = document.fullimage.src; var contents = '<html><body style="margin:0px;"><img src="'+url+'" /></body></html>'; imagewindow = window.open(url,'imagelaunch','scrollbars=no,resizable=no,toolbar=no,location=no,status=yes,menubar=no'); imagewindow.document.write(contents); } but that doesn't work :S Link to comment Share on other sites More sharing options...
DarkSoul520 Posted June 7, 2006 Author Share Posted June 7, 2006 This is a css problem, so basically your going to have to write some style properties to the new window along with your picture, namely margin:0px.This should do the job <script language="JavaScript">function openNewWindow(URLtoOpen, windowName, windowFeatures) {newWindow=window.open("", windowName, windowFeatures);contents="<body style='margin:0px;'><img src='"+URLtoOpen+"' /></body>";newWindow.document.write(contents); }</script> <{POST_SNAPBACK}> I pasted that where my old code was and it didn't work.And asylum, could you explain more of what you are talking about? Link to comment Share on other sites More sharing options...
scott100 Posted June 7, 2006 Share Posted June 7, 2006 (edited) I pasted that where my old code was and it didn't work.It works fine for me, well i can only test it on IE right now and it works in that, try this link.http://scott100.atspace.com/NewWindow.htmEDIT did you remember and put the : after javascript? Edited June 7, 2006 by scott100 Link to comment Share on other sites More sharing options...
Little Goat Posted June 7, 2006 Share Posted June 7, 2006 it works in FF too. Link to comment Share on other sites More sharing options...
asylum Posted June 7, 2006 Share Posted June 7, 2006 Just make a blank html page that contains an image tag with no src. Then when you want to display an image in a new window open that html page instead and then rewrite the src of that img tag in the page to be the src of the desired image.Does that make more sense? Link to comment Share on other sites More sharing options...
DarkSoul520 Posted June 7, 2006 Author Share Posted June 7, 2006 Something is not right here. I made a new page and posted the code that scott100 used on a black page and I get this.http://www.freewebs.com/darksoul520/OMFGTEST.htmThe Pop-up doesn't even work.Is there something wrong with freewebs? Link to comment Share on other sites More sharing options...
scott100 Posted June 7, 2006 Share Posted June 7, 2006 Is there something wrong with freewebs? I don't know if something is wrong but they are adding in an external javascript to your code which is causing the error.function openNewWindow(URLtoOpen, windowName, windowFeatures) {newWindow=window.open("", windowName, windowFeatures);contents="<body style='margin:0px;'><img src='"+URLtoOpen+"' /><!-- --><script type="text/javascript" src="/i.js"></script></body>";newWindow.document.write(contents); } Link to comment Share on other sites More sharing options...
asylum Posted June 8, 2006 Share Posted June 8, 2006 my suggestion, move to awardspace.com or somewhere that isn't freewebs Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now