Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  5. <link rel="stylesheet" href="http://qtip2.com/v/stable/jquery.qtip.css">
  6.  
  7.  
  8. <script src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
  9.  
  10. <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
  11.  
  12. <script src="http://qtip2.com/v/stable/jquery.qtip.js"></script>
  13. <script src="http://qtip2.com/v/stable/jquery.qtip.js"></script>
  14.  
  15.  
  16. <meta charset="utf-8">
  17.  
  18. </head>
  19. <body>
  20. <div id="project-label">Select a Veicle :</div>
  21. <input id="project" style="width:380px;">
  22. </body>
  23. </html>
  24.  
  25. (function($){
  26.  
  27. var $project = $('#project');
  28.  
  29. var projects = [
  30. {
  31. value: "Auto",
  32. label: "Auto",
  33. desc: "It Runs",
  34. icon: "jquery_32x32.png"
  35. }
  36. ];
  37.  
  38. $project.autocomplete({
  39. minLength: 0,
  40. source: projects,
  41. select: function (event, ui) {
  42. var elem = $(event.originalEvent.toElement);
  43. if (elem.hasClass('ac-item-a')) {
  44. $("#myform").show(500);
  45. }
  46. },
  47. focus: function( event, ui ) {
  48. $project.val( ui.item.label );
  49. return false;
  50. }
  51. });
  52.  
  53. $project.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
  54. var inner_html = '<table border-bottom:1pt solid black;><tr><td rowspan="2"><img src="https://jqueryui.com/resources/demos/autocomplete/images/' + item.icon + '"></td><td>' + item.value + '</div><div><font size="2" color="black">' + item.desc + '</font></td><td><img id="informationId" src="http://static4.wikia.nocookie.net/__cb20131121214007/destinypedia/images/7/71/Information_Icon.svg" height=42></td></tr></table>';
  55. return $("<li></li>")
  56. .data("item.autocomplete", item) .append(inner_html)
  57. .appendTo(ul);
  58. };
  59.  
  60. $('img[src]').qtip({
  61. content: {
  62. text: 'Alternate Names for auto <br>'+
  63. '<br>Synopsis : The best auto u can find'
  64. }
  65.  
  66. });
  67.  
  68.  
  69.  
  70. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement