delay loading of deputies pictures after the page is fully loaded
This commit is contained in:
parent
6719016cdc
commit
b5325137f7
|
@ -27,11 +27,19 @@
|
|||
|
||||
<dt id="fieldsetlegend-photographies">Répertoire photos de A-Z</dt>
|
||||
<dd id="fieldset-photographies">
|
||||
<script type="text/javascript">
|
||||
/* delay loading of deputies photos after the page is fully loaded */
|
||||
jQuery(window).load(function(){
|
||||
$('#fieldset-photographies a').each(function() {
|
||||
$(this).find('span').before('<img src="' + $(this).attr('data-src') + '"/>');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<tal:block tal:repeat="entry view/sortedDeputies">
|
||||
<div tal:condition="entry/picture">
|
||||
<a tal:attributes="href entry/absolute_url"><img
|
||||
tal:attributes="src string:${entry/id}/photo"/>
|
||||
<span tal:content="entry/Title"/>
|
||||
<a tal:attributes="href entry/absolute_url;
|
||||
data-src string:${entry/id}/photo;">
|
||||
<span tal:content="entry/Title"/>
|
||||
</a>
|
||||
</div>
|
||||
</tal:block>
|
||||
|
|
Reference in New Issue