Skip to content

Instantly share code, notes, and snippets.

@kristof
Last active February 15, 2018 01:45
Show Gist options
  • Save kristof/18db354a08057813e5dc9a99f33fa08e to your computer and use it in GitHub Desktop.
Save kristof/18db354a08057813e5dc9a99f33fa08e to your computer and use it in GitHub Desktop.
Bookmarklet for hiding the Invision UI + hotspots
javascript: (function() {
var bottomBar = document.getElementById('bottom_bar');
var trayToggle = document.getElementsByClassName('hide-tray-toggle');
var screensViewerNav = document.getElementById('screens_viewer_nav');
var poweredBy = document.getElementsByClassName('powered-by');
var toolbar = document.getElementsByClassName('toolbar');
var slideshowNav =document.getElementsByClassName('slideshow-nav');
var hotspots = document.getElementsByClassName('hotspot');
if(bottomBar) { bottomBar.remove(); }
if(trayToggle.length && trayToggle[0]){ trayToggle[0].remove(); }
if(screensViewerNav){ screensViewerNav.remove(); }
if(poweredBy.length && poweredBy[0]){ poweredBy[0].remove(); }
if(toolbar.length && toolbar[0]){ toolbar[0].remove(); }
if(slideshowNav.length && slideshowNav[0]){ slideshowNav[0].remove(); }
var removeHotspots = function() {
for (var i = 0; i < hotspots.length; i++) {
hotspots[i].style.backgroundColor = 'transparent';
hotspots[i].style.border = 'none';
}
};
removeHotspots();
var interval = setInterval(function(){
removeHotspots();
}, 200);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment