10 examples of 'visibility jquery' in JavaScript

Every line of 'visibility jquery' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
369function is_element_visible(jq_element) {
370 // Returns true if jq_element is currently on the visible part of
371 // the html page.
372
373 // element must not be hidden
374 if (!jq_element.is(":visible")) return false;
375 // element is invisible if its bottom is above the top of the window
376 if ((jq_element.offset().top + jq_element.height()) < $(window).scrollTop()) return false;
377 // or its top below the bottom of the window
378 if (jq_element.offset().top > ($(window).scrollTop() + $(window).height())) return false;
379 return true;
380}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

141function isVisible(element_id) {
142 var elm = document.getElementById(element_id);
143
144 return elm && elm.style.display != "none";
145}
131function setvisibility(id,state) {
132 try {
133 document.getElementById(id).style.visibility = state;
134 } catch(e) {}
135}
2function switchVisibility (varargs) {
3 for (i = 0; i < arguments.length; i++) {
4 var obj = document.getElementById(arguments [i]);
5 if (obj.style.display == "block" || obj.style.display == null || obj.style.display == "") {
6 obj.style.display = "none";
7 } else if (obj.style.display == "none") {
8 obj.style.display = "block";
9 }
10 }
11}
28function get_visible (id)
29{
30 var element = document.getElementById(id);
31
32 if (element &&
33 element.style.display &&
34 element.style.display != "none")
35 return true;
36 return false;
37}
44function $visible_qsa(selector, val) {
45 var nodes = document.querySelectorAll(selector);
46 for (var i = 0;i < nodes.length;i++) {
47 $visible(nodes[i], val);
48 }
49}
370function check_visibility(type) {
371 cb = $("#cb_tt_"+type);
372 div = $("#hoard_tt_"+type);
373 if (cb.prop("checked")) {
374 div.show();
375 return 1;
376 }
377 else {
378 div.hide();
379 return 0;
380 }
381}
1105function getSearchFieldVisibility(container) {
1106 return container.not('.search-disabled').length > 0;
1107}
1function toggleVisibility(divId, linkDivId, linkText) {
2 var theDiv = document.getElementById(divId);
3 var theLinkDiv = document.getElementById(linkDivId);
4 var isVisible = theDiv.style.visibility == "visible";
5 theLinkDiv.innerHTML = isVisible ? linkText : "hide";
6 theDiv.style.visibility = isVisible ? "hidden" : "visible";
7}
87function setVisible (selector, signature, stateAccess, stateAccess2) {
88 var $item = $(selector)
89 if (!signature || signature.indexOf('@') < 0 ||
90 signature.indexOf(stateAccess) >= 0 ||
91 (stateAccess2 && signature.indexOf(stateAccess2) >= 0)) {
92 $item.show()
93 } else {
94 $item.hide()
95 }
96}

Related snippets