Javascript Photoviwer help...

jgilbreath04

New Member
I have downloaded a free photoviewer for my site and cannot seem to get my personal pictures to work with it. The code I am using is as listed below:

<script type="text/javascript"
src="http://slideshow.triptracker.net/slide.js"></script>
<script type="text/javascript">
<!--
var viewer = new PhotoViewer();
viewer.add('/photos/my-photo-1.jpg');
viewer.add('/photos/my-photo-2.jpg');
viewer.add('/photos/my-photo-3.jpg');
//--></script>
<a href="javascript:void(viewer.show(0))"> Open Photo Viewer</a>

As of right know the script runs just fine. I just cannot seem to figure out the code to replace '/photos/my-photo-1.jpg' with my personal directory information so it will work.

so if anyone could throw a coding noob a bone it would be much appreciated.

Thank you very much for your time,
Joshua Gilbreath
 

adamblan

New Member
It depends on your site's directory structure... Assuming that your index page is in the root, replace '/photos/my-photo-1.jpg' with 'photos/photo_name.jpg'
- You should probably also get rid of the <!-- comment --> tags ;)
 

jgilbreath04

New Member
I have made the suggested changes and still cannot get the viewer to act as I think it should. It still comes will not display the photos I am trying to get it to, or any others for the matter.

Here is the code, any suggestions? I am lost right now.


<script type="text/javascript"
src="http://slideshow.triptracker.net/slide.js"></script>
<script type="text/javascript">

var viewer = new PhotoViewer();
viewer.add('C:\Users\Joshua\Jixan Designs\Photos\1.jpeg');
//</script>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="javascript:void(viewer.show(0))"> Open PhotoViewer </a>



Thanks again,
Joshua Gilbreath :confused:
 

horrorshow75

New Member
Are you trying to do this locally from your computer? I notice the picture path is trying to point to your local C: drive.

If this is script is out on webserver that is your problem right there.

You should ditch all those non-breaking spaces. You should create a css class to position that link.
 
Last edited:

jgilbreath04

New Member
This is where I got the viewer script at if that helps, yes I directing it to my local c:. Is this not possible or do I need to have it directed from a URL?

Thanks again,
Joshua Gilbreath
 

horrorshow75

New Member
If you are running locally from your c: drive put the .html file and your images folder in the same folder. Then make your image paths as follows 'image_folder_name/photo.jpg'. You should never use absolute paths like the one in your previous post because they obviously won't work when you upload to a webserver.
 
Last edited:

adamblan

New Member
Set your links relative to the index page... try

viewer.add(Photos\1.jpeg');

instead of
viewer.add('C:\Users\Joshua\Jixan Designs\Photos\1.jpeg');

;)
 

adamblan

New Member
just noticed this, but you should change the backslash to a forward slash...

viewer.add(Photos/1.jpeg');
 

jgilbreath04

New Member
Well guess what, the noob is still having problems with the viewer.

The folder structure is listed as followed.

Jixan Designs/Photos/1.jpeg

The index.html is in the Jixan Designs folder, the pics are in the Photos folder. And I am still getting a blank viewer.

I have set the viewer.add to

viewer.add(Photos/1.jpeg');

Anything else I need to change? Here is the current script:

<script type="text/javascript"
src="http://slideshow.triptracker.net/slide.js"></script>
<script type="text/javascript">

var viewer = new PhotoViewer();
viewer.add('Jixan Designs/Photos/1.jpeg');
//</script>

Thanks again,
Joshua Gilbreath
 

jgilbreath04

New Member
Just wanted to say I finally figured this out! Just wanted to post the update. I ended up putting the photos in the same folder the .html page was. so the Script ended up looking like this.

<script type="text/javascript"
src="http://slideshow.triptracker.net/slide.js"></script>
<script type="text/javascript">

var viewer = new PhotoViewer();
viewer.add('1.jpeg');
</script>

Thank you everyone for the help, I could not have got this thing running without you!

Thank you!
Joshua Gilbreath
 
Top