Difference between revisions of "MediaWiki:Common.js"
From Complex Time
WikiWorks2 (talk | contribs) |
WikiWorks2 (talk | contribs) |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
+ | |||
+ | if (/iPhone|iPod|iPad/.test(navigator.userAgent)) { | ||
+ | $('iframe').wrap(function() { | ||
+ | var $this = $(this); | ||
+ | return $('<div></div>').css({ | ||
+ | width: $this.attr('width'), | ||
+ | height: $this.attr('height'), | ||
+ | overflow: 'auto', | ||
+ | '-webkit-overflow-scrolling': 'touch' | ||
+ | }); | ||
+ | }); | ||
+ | } |
Revision as of 12:03, January 26, 2019
/* Any JavaScript here will be loaded for all users on every page load. */ if (/iPhone|iPod|iPad/.test(navigator.userAgent)) { $('iframe').wrap(function() { var $this = $(this); return $('<div></div>').css({ width: $this.attr('width'), height: $this.attr('height'), overflow: 'auto', '-webkit-overflow-scrolling': 'touch' }); }); }