floatbox doesnt work locally.

Page: 1

Author Post
rctong
Guest
I tried testing a webpage with floatbox on my external harddrive (not C: but I:) but when i click on the link that is supposed to activate floatbox, the image appears on a new page rather than dimming and appearing over the current page.

BUT... when i upload the webpage to my isp, floatbox works as its supposed to.

Anyone have any clues to whats going on? It would be nice to test locally before uploading to the isp.

Thanks
Ryan
Administrator
Registered: Aug 2008
Posts: 3382
You need relative paths (which can be a pain) when running off a file system.
If your page is in the same folder as the floatbox folder, your include lines would look like:
<link type="text/css" rel="stylesheet" href="floatbox/floatbox.css" />
<script type="text/javascript" src="floatbox/floatbox.js"></script>

(Note the absence of the leading slash character on the paths.)

If your pages are one level down from the floatbox files, it would look like this:
<link type="text/css" rel="stylesheet" href="../floatbox/floatbox.css" />
<script type="text/javascript" src="../floatbox/floatbox.js"></script>


etc...

There's advantages to installing a local web server on your PC for development and testing. Path management is just one of them.

Page: 1