Last active
January 13, 2018 17:46
-
-
Save ryanpcmcquen/1229119ffcf5098543c0 to your computer and use it in GitHub Desktop.
invisibleCopyItemForSimpleJsCopy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global window*/ | |
/*jslint browser: true*/ | |
(function () { | |
"use strict"; | |
window.addEventListener("load", function () { | |
var iPhoneORiPod = false; | |
var iPad = false; | |
var safari = false; | |
if (navigator.userAgent.match(/iPhone|iPod/i)) { | |
iPhoneORiPod = true; | |
} else if (navigator.userAgent.match(/iPad/i)) { | |
iPad = true; | |
} else if (/^((?!chrome).)*safari/i.test(navigator.userAgent)) { | |
safari = true; | |
} | |
var copyItem = document.querySelector(".text-to-copy"); | |
if (iPhoneORiPod || iPad || safari) { | |
copyItem.style.opacity = 1; | |
copyItem.style.position = "relative"; | |
} | |
}); | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment