Rudimentary problem

Page: 1

Author Post
Josh
Guest
I'm embarassed to be posting what must be such a basic problem.
I can't get the damn thing to work. Now I've used Lightbox before so I'm not completely clueless, but I've spent hours on it and I cannot get even basic functionality out of float box.

Here's the code out of my index.html. It's stripped down to focus on this issue.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link type="text/css" rel="stylesheet" href="/floatbox/floatbox.css" />
<script type="text/javascript" src="/floatbox/floatbox.js"></script>
<head>
<body>
<a href="images/chicago_alley.jpg" rel="floatbox"><img src="images/thumbnails/chicago_alley_thumbnail.gif" width="87" height="120" /></a>
</body>
</html>

You'll just have to take my word for it that the paths are correct, but I can assure you they are. If anybody can spot a problem I'd appreciate it

Josh
Administrator
Registered: Aug 2008
Posts: 3382
So far, 100% of the "it just won't work" problems have been either an install path problem or a permissions problem. A good way to identify these issues is to attempt loading the js and css directly in your browser. In other words, try http://YourDomain/floatbox/floatbox.js and http://YourDomain/floatbox/floatbox.css directly in your browser's address bar and see what you see. The response from those attempts should give you enough clues to track down the install/config problem.

Failing that, I'd need to see it online somewhere to be able to comment further.
Josh
Guest
This isn't even online yet, it's a new site in dreamweaver CS3.
Administrator
Registered: Aug 2008
Posts: 3382
Yeah, but what were the results of placing the urls of the js and css directly in the browser address bar?
Josh
Guest
the css opened just fine like a txt file. The js launched dreamweaver and opened.
Administrator
Registered: Aug 2008
Posts: 3382
Quote
The js launched dreamweaver and opened.

Hmmm. Are you running/testing your content from a web server (Apache or IIS) or just off the local file system as files? Floatbox is intended to be part of web pages served by a web server.
Josh
Guest
It's off my local hard drive. is there anything I can change to make it compatible?
Administrator
Registered: Aug 2008
Posts: 3382
I think you'll have nothing but trouble without a local web server.
I did a quick test and was surprised to find I could get floatbox working in IE, Chrome and Safari from the file system, but it wouldn't work in Firefox or Opera.

In my case, the root of my test web site is in my c:\htdocs\randomous folder. I had to prepend "/htdocs/randomous" to all my absolute paths including the 2 floatbox include lines.

Running from the local file system is not something I'm prepared to support, so all I can do is wish you good luck.
Josh
Guest
Thank you very much for the effort
Leeloo
Guest
I copy/pasted your code and it is good
To test floatbox on local file system, delete the "/" at the beginning of the two href like this :

<link type="text/css" rel="stylesheet" href="floatbox320/floatbox.css" />
<script type="text/javascript" src="floatbox320/floatbox.js"></script>

It may be a bad idea but it works well for me online with all major browsers...
Administrator
Registered: Aug 2008
Posts: 3382
Yes, relative paths seem to be the way to go when running against a file system. What you've done by removing the beginning "/" is to make the paths relative to the current folder. This works only for pages that are at the same level in the folder hierarchy as the floatbox folder (or in the case of the quoted example, the floatbox320 folder). Put a page in any other folder and that include path will be wrong. So for each folder level you go down you need to adjust the relative paths with the appropriate number of parent folder references, such as "../floatbox/floatbox.js", "../../floatbox/floatbox.js", etc.

I would think that installing a local dev/test web server would take about the same amount of time as futzing around trying to get everything working off the file system. And you then get the advantage of opening your tool set up to true web technologies like php, asp, forms, cgi, templating systems, server side includes, database driven content, etc., etc. And you have the advantage of then developing and testing on the same server technology that you will be publishing to. But this is just the preference of an opinionated SOB. If the file system is working for your purposes, more power to you. :)

Page: 1