Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Location
    N. Ireland
    Posts
    351
    Thanks
    16
    Thanked 4 Times in 4 Posts

    jQuery Galleryview with XML

    Hi guys,

    ben using jQuery GalleryView (1.4 and 2.1) to good effect but recently been asked to incorporate an XML file to build up the image list dynamically.

    The XML contents will be in the format:
    Code:
    <MediaProxy><thumbnail>some_location.jpg</thumbnail></MediaProxy>...
    I can parse the XML:
    Code:
    <script type="text/javascript">
    $(document).ready(function()
    {
      $.ajax({
        type: "GET",
        url: "list-images.xml",
        dataType: "xml",
        success: parseXml
      });
      
    });
    
    
    function parseXml(xml)
    {
    	$(xml).find("MediaProxy").each(function()
    	{
    		$("#photos").append('<li><img src="' + $(this).find("thumbnailUrl").text() + '" alt="'+$(this).find("caption").text()+'" />');
    	}
    	);
    }
    </script>
    I have a UL tag ID photos like my standard implementation but I don't know where to include the relevant jQuery scripts or the Galleryview parameters:
    Code:
    $(document).ready(function()
    {
      $('#photos').galleryView({
    			panel_width: 480,
    			panel_height: 281,
    			frame_width: 40,
    			frame_height: 20,
    			transition_interval:14000,
    			transition_speed:600,
    			pause_on_hover: true,
    			filmstrip_position: 'bottom',
    			frame_scale: 'crop',
    			show_panels: false
      });
    });
    An example of how it should work (with images hard coded into the list) is: XML-Parse2

    And the work in progress file is: XML-Parse

    Any help appreciated.

    D.
    Last edited by daemonkin; 10-06-2010 at 11:52 AM.
    Daemonkin.
    If this was helpful, please add to my reputation
    Thousand Sons - Freelance Web Developer - ninetyonedegrees.com


 

Posting Permissions

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