這可能是一個簡單的答案,但我很難找到它。向砌體添加鼠標懸停事件
我使用砌體插件來填充圖像的頁面。這些圖像是藝術作品。當你將鼠標放在他/她的作品上時,我希望藝術家的名字從底部向上滑動。
現在我只是想讓一個mouseover事件工作,但沒有發生。任何人都可以幫忙嗎?
$(document).ready(function(){
$.get("artists.json", function(data){
json = $.parseJSON(data);
$.each(json, function(i, data){
$("#container").append("<div class='thumbnail small' id='" + data.id + "' index='"+i+"' style=\"background:url('" + data.imageofWork + "') no-repeat center center; background-size:cover; \" caption = '"+data.artistName+"' ></div>");
});
});
$("#container").imagesLoaded(function(){
setTimeout(function()
{
$('#container').masonry({
itemSelector : '.thumbnail',
gutterWidth: 0,
isAnimated: true
});
$("#container").css('visibility','visible').hide().fadeIn('slow', function(){setTimeout(function(){ checkURL();},500)});
},1200)
});
$(document).on("mouseover", ".thumbnail.small", function(){
//console.log($(this));
$(this).css('width:', '110%');
});
我不熟悉div的'caption'屬性,這是masonry.js插件特有的東西嗎? – superUntitled 2013-03-22 18:04:34