Note that there are some explanatory texts on larger screens.

plurals
  1. POJqueryUI Autocomplete callback function using val( ) not working
    primarykey
    data
    text
    <p>I am using jqueryui autocomplete and have set up a search of an image gallery using <a href="http://www.jacksasylum.eu/ContentFlow/index.php" rel="nofollow">ContentFlow</a> that when the image is found, a small icon is shown and the user can open the image with a lightbox (prettyphoto ) </p> <p>Here is the code:</p> <pre><code>$(function() { var projects = [ { value: "Alcatraz", label: "Alcatraz", icon: "Alcatraz.jpg", url: "slides/Alcatraz.jpg", desc: "", imgN: "1" }, { value: "Amber Light", label: "Amber Light", icon: "Amber Light.jpg", url: "slides/Amber%20Light.jpg", desc: "", imgN: "2" }, { value: "Blue Boat", label: "Blue Boat", icon: "Blue Boat.jpg", url: "slides/Blue%20Boat.jpg", desc: "", imgN: "3" } ]; $( "#project" ).autocomplete({ minLength: 0, source: projects, focus: function( event, ui ) { $( "#project" ).val( ui.item.label ); return false; }, select: function( event, ui ) { $( "#project" ).val( ui.item.label ); $( "#project-id" ).val( ui.item.value ); $( "#project-icon" ).attr( "src", "thumbs/" + ui.item.icon ); $( "#project-description" ).html( ui.item.desc ); $( "#project-label" ).html( ui.item.label ); $( "#project-link" ).attr("href", ui.item.url ); $( "#project-link" ).attr("title", ui.item.label ); return false; }, close: function() { var value = $( "#project" ).val( ui.item.imgN ); cf.moveTo(value); } }) .data( "autocomplete" )._renderItem = function( ul, item ) { return $( "&lt;li&gt;&lt;/li&gt;" ) .data( "item.autocomplete", item ) .append( "&lt;a&gt;" + item.label + " - " + item.desc + "&lt;/a&gt;" ) .appendTo( ul ); }; }); </code></pre> <p>The HTML:</p> <pre><code>&lt;div id="project-label"&gt;Search&lt;/div&gt; &lt;a href="#" rel="prettyPhoto" class="" id="project-link"&gt;&lt;img id="project-icon" src="res/transparent_1x1.png"/&gt;&lt;/a&gt; &lt;input id="project"/&gt; &lt;input type="hidden" id="project-id"/&gt; &lt;p id="project-label"&gt;&lt;/p&gt; &lt;p id="project-description"&gt;&lt;/p&gt; </code></pre> <p>The problem I am having is with the following function:</p> <pre><code>close: function() { var value = $( "#project" ).val( ui.item.imgN ); cf.moveTo(value); } </code></pre> <p>I need the image gallery to scroll to the specific image in the contentflow using </p> <pre><code> cf.moveTo(); </code></pre> <p>I am not getting my code to return this value. Any help would be appreciated.</p>
    singulars
    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.
 

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