Results 1 to 5 of 5

Thread: to load a Photogalery into a Div from external File

  1. #1
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default to load a Photogalery into a Div from external File

    Hi!
    I am using Dynamic Ajax Content to load an external page with text, pictures and photogalery(in Javascript) into a DIV. However, I am only able to load the text,pictures and not the photogalery. How can I solve this?

    Thanks in advanse:-)

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Please provide a link to the page - we need to see the gallery javascript to understand what the problem is.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  3. #3
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks Berverleyh!

    I used the script underhttp://www.dynamicdrive.com/dynamici...jaxcontent.htm
    to load a text and a Photogallery into a div 'Content'

    <li><a class="MenuBarItemSubmenu" href="javascript:ajaxpage('photo.html', 'Content');
    loadobjs('simplegallery.js','jquery-1.2.6.pack.js','PhotoGalery.js')"> photo</a>
    how can I expend the script under the Link above to make the photogallery work?

  4. #4
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    Need a link to your page - a working/non-working environment to see your setup.
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

  5. #5
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    A lazy method would be to use an iframe instead of Ajax, like this (replace Google and DynamicDrive with your external pages):
    Code:
    <head>
    
    <style type="text/css">
    .external {position:absolute;left:20%;width:70%;top:20%;height:70%;overflow:auto; border: 2px inset #dedede}
    </style>
    
    <script type="text/javascript">
    included1 = '<div class="external"><iframe src="http://www.google.com" frameborder="0" style="width:100%; height: 100%"><\/iframe><\/div>' ;
    included2 = '<div class="external"><iframe src="http://www.dynamicdrive.com" frameborder="0" style="width:100%; height: 100%"><\/iframe><\/div>' ;
    </script>
    
    <script type="text/javascript">
    function remove(id)
    {
    while(document.getElementById(id).firstChild)
    {document.getElementById(id).removeChild(document.getElementById(id).firstChild);}
    }
    
    function include(which,id){
    var newdiv = document.createElement("div");
    newdiv.innerHTML = which;
    
    remove(id); document.getElementById(id).appendChild(newdiv);
    }
    </script>
    
    </head>
    <body >
    <div id="gallery" ></div>
    
    <a href="javascript: void(0)" onclick='include(included1,"gallery");'>load google</a><br>
    
    <a href="javascript: void(0)" onclick='include(included2,"gallery");'>load dynamicdrive</a><br>
    
    <a href="javascript: void(0)" onclick='remove("gallery")'>remove</a><br>
    
    </body>
    Arie Molendijk.

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
  •