Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I didn't find anything but it shouldn't be too hard to write something.</p> <p>Use PHP, Perl, Python, .NET, etc and create a server side script that returns a JSON object. Since you only asked for help with jQuery I assume you know how to write your own server scripts. The following is just one way you could do this using jQuery.</p> <p>Return a JSON object like this...</p> <pre><code>{"items":[{"img":"http://www.png","url":"http://www.html","name":"Item A"}, {"img":"http://www.png","url":"http://www.html","name":"Item B"}, {"img":"http://www.png","url":"http://www.html","name":"Item C"}], "collection_id":100} </code></pre> <p>Write some javascript to ask for and render the result like this...</p> <pre><code>function onGotData(data) { jQuery('#itemA .item_name').text(data.items[0].name); jQuery('#itemA .item_image').attr('src', data.items[0].img); jQuery('#itemA').click( function() { document.location = data.items[0].url }); jQuery('#itemB .item_name').text(data.items[1].name); jQuery('#itemB .item_image').attr('src', data.items[1].img); jQuery('#itemB').click( function() { document.location = data.items[1].url }); jQuery('#itemC .item_name').text(data.items[2].name); jQuery('#itemC .item_image').attr('src', data.items[2].img); jQuery('#itemC').click( function() { document.location = data.items[2].url }); collection_id = data.collection_id; } var collection_id = 100; function getData(direction, id) { // change images to loading animation jQuery('#itemA .item_image').attr('src', 'loading.gif'); jQuery('#itemB .item_image').attr('src', 'loading.gif'); jQuery('#itemC .item_image').attr('src', 'loading.gif'); jQuery.getJSON('http://path.to/yourscript?collection=' + direction + '&amp;id=' + id,null,onGotData ); } </code></pre> <p>Assume some HTML like this to hold how ever many items you have.</p> <pre><code>&lt;span class="item" id="itemA"&gt; &lt;span class="item_name"&gt;Name&lt;/span&gt; &lt;img class="item_image" src="loading.gif"&gt;&lt;/span&gt; &lt;/span&gt; </code></pre> <p>Then toss some buttons on the end. </p> <pre><code>&lt;div id="goLeft"&gt;&lt;img src="left.gif"&gt;&lt;/div&gt; &lt;div id="goRight"&gt;&lt;img src="right.gif"&gt;&lt;/div&gt; </code></pre> <p>Then make the buttons clickable...</p> <pre><code>jQuery('#goLeft').click( function() { getData('left', collection_id ); }); jQuery('#goRight').click( function() { getData('left', collection_id ); }); </code></pre> <p>That took about 10 minutes but you should hopefully be able to fill in the blanks and make what you're looking for. The #jQuery irc.freenode.net will be able to help you further once you start working on your live page. They are generally very helpful if you're willing to work with them.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload