Last active
December 17, 2015 19:39
-
-
Save bkoopman/5662397 to your computer and use it in GitHub Desktop.
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
/* | |
* Experience Manager show/hide | |
*/ | |
(function ($, window, i) { | |
$.fn.xpmShowHide = function (options) { | |
return this.each(function () { | |
i++; | |
var $this = $(this); | |
if (window.self === window.top) { | |
// not in a frame | |
$this.hide(); | |
} else { | |
// in a frame (probably experience manager) | |
$this.show(); | |
} | |
}); | |
} | |
})(jQuery, this, 0); | |
$(document).ready(function() { | |
// show or hide elements specifically for experience manager | |
$(".xpm-only").xpmShowHide(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment