Skip to content

Commit

Permalink
add IE workaround for horizontal sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Mar 28, 2017
1 parent aa288fa commit 3e55843
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions scripts/juxtaposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,11 +431,13 @@ H5P.ImageJuxtaposition = function ($) {

this.rightImage = document.createElement("div");
this.rightImage.className = 'jx-image jx-right';
this.rightImage.appendChild(this.imgAfter.image);
this.rightImageIMG = $(this.imgAfter.image).addClass('jx-rightimg');
this.rightImage.appendChild(this.rightImageIMG[0]);

this.leftImage = document.createElement("div");
this.leftImage.className = 'jx-image jx-left';
this.leftImage.appendChild(this.imgBefore.image);
this.leftImageIMG = $(this.imgBefore.image).addClass('jx-leftimg');
this.leftImage.appendChild(this.leftImageIMG[0]);

this.slider.appendChild(this.handle);
this.slider.appendChild(this.leftImage);
Expand Down Expand Up @@ -530,6 +532,10 @@ H5P.ImageJuxtaposition = function ($) {
self.setWrapperDimensions();
self.updateSlider(this.options.startingPosition, false);
this.parent.trigger('resize');

// This is a workaround for horizontal sliders in our beloved IE
$('.jx-leftimg').attr('width', '');
$('.jx-rightimg').attr('width', '');
}
};

Expand Down

0 comments on commit 3e55843

Please sign in to comment.