| 35 | } |
| 36 | |
| 37 | function addElement (pokemonId, name) { |
| 38 | jQuery('<div/>', { |
| 39 | id: 'seen_' + pokemonId, |
| 40 | class: 'item' |
| 41 | }).appendTo('#seen_container') |
| 42 | |
| 43 | jQuery('<div/>', { |
| 44 | id: 'seen_' + pokemonId + '_base', |
| 45 | class: 'container' |
| 46 | }).appendTo('#seen_' + pokemonId) |
| 47 | |
| 48 | var imageContainer = jQuery('<div/>', { |
| 49 | class: 'image' |
| 50 | }).appendTo('#seen_' + pokemonId + '_base') |
| 51 | |
| 52 | jQuery('<i/>', { |
| 53 | class: 'pokemon-sprite n' + pokemonId |
| 54 | }).appendTo(imageContainer) |
| 55 | |
| 56 | var baseDetailContainer = jQuery('<div/>', { |
| 57 | class: 'info' |
| 58 | }).appendTo('#seen_' + pokemonId + '_base') |
| 59 | |
| 60 | jQuery('<div/>', { |
| 61 | id: 'name_' + pokemonId, |
| 62 | class: 'name' |
| 63 | }).appendTo(baseDetailContainer) |
| 64 | |
| 65 | jQuery('<a/>', { |
| 66 | id: 'link_' + pokemonId, |
| 67 | href: 'http://www.pokemon.com/us/pokedex/' + pokemonId, |
| 68 | target: '_blank', |
| 69 | title: 'View in Pokedex', |
| 70 | text: name |
| 71 | }).appendTo('#name_' + pokemonId) |
| 72 | |
| 73 | jQuery('<div/>', { |
| 74 | id: 'seen_' + pokemonId + '_details', |
| 75 | class: 'details' |
| 76 | }).appendTo('#seen_' + pokemonId) |
| 77 | |
| 78 | jQuery('<div/>', { |
| 79 | id: 'count_' + pokemonId, |
| 80 | class: 'seen' |
| 81 | }).appendTo('#seen_' + pokemonId + '_details') |
| 82 | |
| 83 | jQuery('<div/>', { |
| 84 | id: 'lastseen_' + pokemonId, |
| 85 | class: 'lastseen' |
| 86 | }).appendTo('#seen_' + pokemonId + '_details') |
| 87 | |
| 88 | jQuery('<div/>', { |
| 89 | id: 'location_' + pokemonId, |
| 90 | class: 'location' |
| 91 | }).appendTo('#seen_' + pokemonId + '_details') |
| 92 | |
| 93 | jQuery('<a/>', { |
| 94 | href: 'javascript:void(0);', |