moselle: pass index parameter to insertRule, required in old browsers

This commit is contained in:
Frédéric Péters 2018-06-24 12:04:30 +02:00
parent ddfb83944e
commit 5be0903c6f
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ $(function() {
/* set page picture as background */
if (document.body.attributes['data-picture']) {
var sheet = document.head.appendChild(document.createElement("style")).sheet;
sheet.insertRule('body.has-picture nav::after { background-image: url(' + document.body.attributes['data-picture'].value + ')');
sheet.insertRule('body.has-picture nav::after { background-image: url(' + document.body.attributes['data-picture'].value + ')', 0);
}
/* add a class to body when the page got scrolled */
$(window).on('scroll', function() {

View File

@ -2,7 +2,7 @@ $(function() {
/* set page picture as background */
if (document.body.attributes['data-picture']) {
var sheet = document.head.appendChild(document.createElement("style")).sheet;
sheet.insertRule('body.has-picture nav::after { background-image: url(' + document.body.attributes['data-picture'].value + ')');
sheet.insertRule('body.has-picture nav::after { background-image: url(' + document.body.attributes['data-picture'].value + ')', 0);
}
/* add a class to body when the page got scrolled */
$(window).on('scroll', function() {