Javascript 如何使用jQuery和Galleria更新HTML元素?
我正在使用Galleria进行幻灯片放映。我想在Javascript 如何使用jQuery和Galleria更新HTML元素?,javascript,jquery,wordpress,galleria,Javascript,Jquery,Wordpress,Galleria,我正在使用Galleria进行幻灯片放映。我想在阶段旁边放置一个小的“较大”链接 我对“较大”按钮有以下代码: this.fullres = this.create('div', 'fullres'); this.get('fullres').innerHTML = '<a href="#">Larger</a>'; this.appendChild('fullres', this.fullres); 使用JQuery,我希望能够提取活动的图像的rel=标记值,并附加.
阶段旁边放置一个小的“较大”链接
我对“较大”按钮有以下代码:
this.fullres = this.create('div', 'fullres');
this.get('fullres').innerHTML = '<a href="#">Larger</a>';
this.appendChild('fullres', this.fullres);
使用JQuery,我希望能够提取活动的
图像的rel=
标记值,并附加.fullres href
标记。这是我到目前为止的代码,但它不起作用:
var title = $(.images).attr('rel'); // pulls the fullres url from the rel tag
$('.galleria-fullres').attr('href', ); //append the galleria fullres href with the rel info
我得说我看不出这是怎么回事
你知道你在:$(.images)
有打字错误吗?应该是$('.images')
您是否遗漏了$('.galleria fullres').attr('href',)中的第二个参数代码>故意的?这不应该是$('.galleria fullres').attr('href',title)代码>
jquery如何通过按类引用元素来工作?您将获得一个元素数组,而不仅仅是一个。我猜这只是你代码的摘录?我错过什么了吗
您是否可以发布浏览器中看到的这些元素示例的html?这应该是一件相当简单的事情,但我真的不能仅凭这些线条就看到整个画面。凯丹不是这样工作的。但你们可以做的是,创建一个按钮进入全屏,并在全屏上有一个更大的图像
大概是这样的:
$('#galleria').galleria({
// other galleria options here
dataConfig: function( img ) {
// get the fullscreen image
return {
big: $( img ).attr('rel')
};
}
});
var galleria = Galleria.get(0);
$('#fullscreen-button').click(function() {
galleria.enterFullscreen();
});
如何获取对活动映像的引用?它有课堂活动吗?
$('#galleria').galleria({
// other galleria options here
dataConfig: function( img ) {
// get the fullscreen image
return {
big: $( img ).attr('rel')
};
}
});
var galleria = Galleria.get(0);
$('#fullscreen-button').click(function() {
galleria.enterFullscreen();
});