Robin Stevens
Robin Stevens

Reputation: 23

Alternative to JQuery .hide

I need an alternative to Jquery .hide which 'hides' all the content in a div, everything, including any html5 videos that are playing and anything else you can think of.

If you go to www.squbo.com and wait for a video to play, unmute it, and then click on the Squbo logo, you will hear the video is still playing even though the parent div it is in was ".hidden" by jquery

$("#squbologo").load("squbologo.php").click(function(){ $("#homepage").hide(); $("#squbopage").show(); });

Upvotes: 1

Views: 11263

Answers (3)

user1317647
user1317647

Reputation:

jQuery fadeOut method:

.fadeOut();

jQuery css method:

.css("display", "none");

Upvotes: 2

user1467267
user1467267

Reputation:

$('#myIDtag').css('display', 'none');

or

$('#myIDtag').css('opacity', '0.0');

to let the element keep occupying the space where it's in.

Last but not least you also have the visibility CSS property, which will likely do the same as opacity; https://developer.mozilla.org/en-US/docs/CSS/visibility

Pause the video like so:

document.getElementById('home-180').childNodes[0].pause();

Tested live on your website through the console in Safari's Web Inspector. Returns undefined, but pauses the video.

Upvotes: 6

palaѕн
palaѕн

Reputation: 73906

You can use jQuery css method:

$("#divID").css("display", "none");

Upvotes: 0

Related Questions