PDA

View Full Version : facebox1.1



maxisky
11-20-2010, 08:00 PM
1) Script Title: facebox1.1

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/facebox/index.htm

3) Describe problem: I have used this script a lot and like it very much, the only problem I have is it not centering. I know it does cause when clicking on the demo links on your site it centers perfectly.

http://vermontwholesalers.com/product_info.php?cPath=30&products_id=144
is a link to where the popup is triggered from.

Thanks for your help and time.

jscheuer1
11-20-2010, 09:51 PM
OK, that page is a bit of a mess from the point of view of standards and practices.

Here's what you could do:


Change the DOCTYPE to one that invokes standards. Replace (at the very top of the page's source code):






<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

with:


<!DOCTYPE html>

Get rid of the second (highlighted) duplicate script call:


<link rel="stylesheet" type="text/css" href="stylesheet.css">

<script src="facefiles/jquery-1.2.2.pack.js" type="text/javascript"></script>

<link href="facefiles/facebox.css" media="screen" rel="stylesheet" type="text/css" />

<script src="facefiles/facebox.js" type="text/javascript"></script>

<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
</script>

<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
</script>

</head>

Just that much will get it working. But except for IE 7 (and presumably less), it will also change the layout of the page because the boxes going down the left and right sides will each be a bit taller. This makes the entire page taller. You can address this in the rest of the markup/css if you like, or live with it. Look at the cellpadding of the tables. Some of those can be reduced. You may then need supplemental styles for IE 7 and less to keep them from being too short. There could be other ways. If you want help with that, open a new thread for it in the css section. The layout of the page in standards mode has nothing to do with this script other than being required by the script. A modern page (like one used for e-commerce like this one is) should be in standards compliance anyway. And the way it is now works equally poorly, though in a different way, in most other modern browsers.

maxisky
11-21-2010, 01:18 PM
Thanks changing the top worked out good. I like the cart cause it has good features but can be improved a lot in the way it is displayed, (the theme setup) which there is none, have to go through each script to make changes. Eventually I'll have it converted to as much css as I can do in the future. Again thanks very much for your time and help.