Results 1 to 10 of 10

Thread: Links to images in separate html file?

  1. #1
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Question Links to images in separate html file?

    1) Script Title: CMotion Image Gallery

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...iongallery.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

  2. #2
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Is the page php, or could it be?

  3. #3
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I don't want to use php.

  4. #4
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Is there a specific reason, all the html will be the same, it's one line of php.

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

  5. #5
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I am newcomer making a website. I don't know what it will mean for me to use php ;-(

  6. #6
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I am using JavaScript for many elements

  7. #7
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Assuming your server has php set up it will involve nothing really unless you want to learn it. You then
    1. change the extension of your page from .html to .php
    2. create the file.html or whatever you want to call it
    3. 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>"
    4. 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.

  8. #8
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    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...

  9. #9
    Join Date
    Dec 2009
    Posts
    12
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    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.

  10. #10
    Join Date
    May 2007
    Location
    Boston,ma
    Posts
    2,127
    Thanks
    173
    Thanked 207 Times in 205 Posts

    Default

    Not sure of a Javascript way

  11. The Following User Says Thank You to bluewalrus For This Useful Post:

    almute (12-19-2009)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •