PDA

View Full Version : Links to images in separate html file?



almute
12-19-2009, 04:11 PM
1) Script Title: CMotion Image Gallery

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

3) Describe problem:

I want to use a separate html file for the list with the images which are displayed - instead of entering all images in the body itself. This way the images could be more easily replaced.

It means: this part of the body should be in a separate file:

<a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" border=1></a> <a href="javascript:enlargeimage('dynamicbook1.gif', 300, 300)"><img src="dynamicbook1.gif" border=1></a> <a href="http://www.dynamicdrive.com"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a>

How can this be done? Please help

Thanks

Almute

bluewalrus
12-19-2009, 04:12 PM
Is the page php, or could it be?

almute
12-19-2009, 04:16 PM
I don't want to use php.

bluewalrus
12-19-2009, 04:19 PM
Is there a specific reason, all the html will be the same, it's one line of php.



<?php
include('file.html');
?>

almute
12-19-2009, 04:24 PM
I am newcomer making a website. I don't know what it will mean for me to use php ;-(

almute
12-19-2009, 04:25 PM
I am using JavaScript for many elements

bluewalrus
12-19-2009, 04:27 PM
Assuming your server has php set up it will involve nothing really unless you want to learn it. You then

change the extension of your page from .html to .php
create the file.html or whatever you want to call it
put the code in it "<a href="javascript:enlargeimage('dynamicbook1.gif')"><img src="dynamicbook1.gif" border=1></a> <a href="javascript:enlargeimage('dynamicbook1.gif', 300, 300)"><img src="dynamicbook1.gif" border=1></a> <a href="http://www.dynamicdrive.com"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a> <a href="#"><img src="dynamicbook1.gif" border=1></a>"
put the php code in the original page where you want that code to be


Any other pages you want to include this with will need to be php as well.

bluewalrus
12-19-2009, 04:32 PM
Javascript and php are different and can work together.

PHP is server-side it is run before (kinda phrasing?) the page loads.

Javascript is client-side and runs once the page loads throughout the clients activity on the page.

-These might not be the best definitions and are open for better responses hah...

almute
12-19-2009, 04:38 PM
I have tried - but it seams that my testserver doesn't support php.
I am working with Dreamweaver and there I can choose either javascript or php for the testserver.

I had tried with
<script type="text/javascript">
$('#motioncontainer').load('show_inhalt.html');
</script>

With this I can see the images - but they don't move like before when they were on the page itself.

bluewalrus
12-19-2009, 05:42 PM
Not sure of a Javascript way