Been trying to add jquery UI functions to my images I'm loading from a json file. Why won't the tooltip and mouseover work on my img id I'm creating when loading the images? Also, I'm using a jquery ui tab menu, used to load the images directly from my folder through in the html file and have them link to the different tabs in the menu. Is there a way to make it work when I'm loading the images from a json file instead?
$(document).ready(function() {
$(document).tooltip();
$("#click").mouseenter(function() {
$("this").stop().animate({
width: "220px",
height: "170px"
});
});
$().mouseleave(function() {
$(this).stop().animate({
width: "200px",
height: "150px"
});
});
$("#contentBox").tabs();
$("a[href=#click]").click(function() {
$("#contentBox").tabs("option", "active", 1);
});
$("a[href=#recept2]").click(function() {
$("#contentBox").tabs("option", "active", 2);
});
$("a[href=#recept3]").click(function() {
$("#contentBox").tabs("option", "active", 3);
});
$("a[href=#recept4]").click(function() {
$("#contentBox").tabs("option", "active", 4);
});
$("a[href=#recept5]").click(function() {
$("#contentBox").tabs("option", "active", 5);
});
$("a[href=#recept6]").click(function() {
$("#contentBox").tabs("option", "active", 6);
});
$("a[href=#recept7]").click(function() {
$("#contentBox").tabs("option", "active", 7);
});
$("a[href=#recept8]").click(function() {
$("#contentBox").tabs("option", "active", 8);
});
$("a[href=#recept9]").click(function() {
$("#contentBox").tabs("option", "active", 9);
});
var jsonDoc = "mylist.json";
$.getJSON(jsonDoc, function(json) {
var imgList = "";
$.each(json.imgs, function() {
imgList += '<a href="#recept"><img id="click" src= "' + this.imgPath + '"></a>';
});
$("#picList").append(imgList);
});
});