Conditional Element Visibility
Conditionally hide/show elements depending on tracked state
Use Cases
Implementing
<script>
$(function() {
// Update the UI to reflect current tracking state
// especially controls, and conditional visibility
updateTracked();
});
// Refresh UI to show what is being tracked
// with the current tracker type
function updateTracked() {
// Show anything marked to show on tracked state
$("[wfu-show-tracked]").each(function () {
if(window.tracker.isTracked($(this).attr("wfu-show-tracked")))
$(this).show();
else
$(this).hide();
});
// Hide anything marked to hide on tracked state
$("[wfu-hide-tracked]").each(function () {
if(!window.tracker.isTracked($(this).attr("wfu-hide-tracked")))
$(this).show();
else
$(this).hide();
});
// PLACE ADDITIONAL CODE HERE
// When directed to in the feature-specific instructions
}
</script>Last updated