How to update HTML element using jQuery and Galleria?

I use Galleria for slide shows. I want to place a small "Larger" link next to stage.

I have this code for the "Larger" button:

this.fullres = this.create('div', 'fullres');
this.get('fullres').innerHTML = '<a href="#">Larger</a>';
this.appendChild('fullres', this.fullres);

I have this code that assigns each tag a <img> rel=full image URL from a custom page field:

<img ... rel="<?=$attachments[$i]['fullres']?>" />

With jQuery, I hope to pull out the value of the activeimage tag rel=and add the tag .fullres href. This is the code that I have so far, but it does not work:

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
+3
source share
2 answers

Galleria doesn't actually work. But what you can do is create a button to enter full screen mode and enlarge the image in full screen mode.

- :

$('#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();
});
0

, , , ...

, : $(.images)? $('.images').

$('.galleria-fullres').attr('href', );? $('.galleria-fullres').attr('href', title);?

jquery, ? , . , ? - ?

html , ? , .

0

Source: https://habr.com/ru/post/1788044/