LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 12-27-2005, 05:50 PM   #1
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Rep: Reputation: 30
make popup conform to image


So i'm attempting to make the classic thumb sized image gallery that when you click on an image it opens up a pop up using that images size and then when you click on it it closes, thus you can quickly access and view the full sized image, yet i find out that when Firefox loads it up, it adds like 5 pixels of space to the top and left margins making it ugly, of course when you click and hold it, it will then center the image, making it fill it all up. The code is written in php which just outputs html/javascript:
Code:
function imageMakeThumb($image)
{
	global $THUMB_SIZE;
	
	$real_size = getimagesize($image);
	$size = imageScale($image, $THUMB_SIZE);
		
	return "<a href=\"javascript:void window.open('./image.php?img=$image', 'contWindow', 'width=$real_size[0],height=$real_size[1]');\"><img src=\"$image\" width=\"$size[0]\" height=\"$size[1]\" border=\"0\"></a>";
}
which then when generated on my site creates something like:
Code:
<a href="javascript:void window.open('./image.php?img=./projects/moo/images/atmaweapon.gif', 'contWindow', 'width=130,height=130');">
How can i get the window to load only the image and not add any "free" pixels on the side? I've tried using a table and then setting cellpadding and cellspacing to 1, also have tried using valign and <center> to attempt to fix it. Is there any way to fix this? I find it a really annoying problem. I've also gotten a friend to use IE on this and i get the same problem. It's strange. Any ideas?

EDIT: Damn got it working like 10 minutes after this post. Just kept on clicking links from my search, i guess i got lucky this time. Should spend more then 30 mins last time, altough from my point of view, every time i post i get it resolved, so maybe i should just post anyways just to get it working faster, even though i have to excuse myself for my hasty post. Oh well, if anyone is interested, check this link - > http://www.siteexperts.com/tips/html/ts02/page1.asp , basically just tells you to add a css style, and some parameters in the <body> to get it working.

Last edited by bobbens; 12-27-2005 at 06:06 PM.
 
Old 12-27-2005, 11:26 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
I can't argue with the fact that it works, but unfortunately using deprecated attributes like "TOPMARGIN" probably isn't a good solution, either.

Please try something like this and see if it works:
Code:
// head stuff
<style type="text/css">
<!--
body {margin:0;padding:0;}
/* other style definitions */
-->
</style>
Here's the link I got it from:
http://www.zytrax.com/tech/css/workarounds.html

Very, very highly recommended book, if you're interested in pursuing CSS ... and need good, practical advise on how to try to write good, conformant CSS in a world full of totally nonconformant browers:

Professional CSS: Cascading Style Sheets for Web Design:
http://www.bookpool.com/sm/0764588338
 
Old 12-28-2005, 03:33 AM   #3
bobbens
Member
 
Registered: Sep 2004
Location: Barcelona
Distribution: Debian, FreeBSD, Gentoo
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by paulsm4
I can't argue with the fact that it works, but unfortunately using deprecated attributes like "TOPMARGIN" probably isn't a good solution, either.

Please try something like this and see if it works:
Code:
// head stuff
<style type="text/css">
<!--
body {margin:0;padding:0;}
/* other style definitions */
-->
</style>
Here's the link I got it from:
http://www.zytrax.com/tech/css/workarounds.html

Very, very highly recommended book, if you're interested in pursuing CSS ... and need good, practical advise on how to try to write good, conformant CSS in a world full of totally nonconformant browers:

Professional CSS: Cascading Style Sheets for Web Design:
http://www.bookpool.com/sm/0764588338
The thing about those deprecated attributes, is that if the browser is old, it's probably the only one that works. The main problem is that since this website is not for me, but for a friend, who gets views from all types of people, i'd like to get maximum compatibiility with all sorts of browsers, even though if the site was for me i wouldn't do all the crappy IE hacks you have to do to get it working in IE. With only the margin:0pt i can get it working in my browser (firefox 1.5), but since i'm not too sure about the more archaic ones, and i don't have any others, i can't test the CSS and see if it works everywhere.
I'm not too into CSS (only for practical use), because i enjoy more the PHP. I just know enough CSS, javascript and html to make things look ok, without being too fancy, but i have alot more fun in PHP, altough once i learn python i might start making sites in python .
Well i am just tempted to say, "best viewed in anything not internet explorer" and just stop makeing stupid hacks for them. I probably will, why support things not standard and inferior? Thanks for the advice, i'll be taking out the obsolete tags now followed by all my hacks to attempt to find the width and height in all non-compliant browsers (which usually doesnt work anyways).

Man the posts i don't write in one sitting always seem less coherent ><.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make an image of your system? Lleb_KCir Linux - General 8 10-25-2004 03:47 PM
what ANSI C++ version does gcc 3.2.3 conform to? kmullin Programming 1 05-26-2004 02:32 PM
How do I make a message box popup for all users? Joey.Dale Linux - General 3 04-09-2004 12:49 AM
Make MozillaFirebird block sites *not popup/ads* GT_Onizuka Linux - Software 4 11-02-2003 03:52 PM
make iso image im1crazyassmofo Linux - General 4 05-19-2003 04:39 PM


All times are GMT -5. The time now is 11:00 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration