我有3个小div,当您单击时,我想在页面顶部弹出一个较大的div,唯一的问题是我根本无法正常工作,也不知道为什么。
我正在尝试更新
$('.highlight-image').on('click', function (e) {
console.log('clicked');
var currImg = $(this).find('.imageHolder').children('img').attr('src');
var currP = $(this).find('blockquote').text;
var targetImg = $('.featuredTestimonial img');
var targetName = $('.featuredTestimonial h2');
var targetP = $('.featuredTestimonial p');
$('.featuredTestimonial p').text = currP;
$('.featuredTestimonial img').attr('src'); = currImg;
});
http://jsfiddle.net/6qcpg/2/
最佳答案
更改
$('.featuredTestimonial img').attr('src'); = currImg;
至
$('.featuredTestimonial img').attr('src', currImg);