how to locate Iframe DIV id find and Hide..

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
danjapro
Forum Commoner
Posts: 72
Joined: Mon Sep 27, 2004 10:56 am

how to locate Iframe DIV id find and Hide..

Post by danjapro »

I am trying to get to see if a specific label id HTML is '*gender' is visible and if it is hide another ID located on the parent to the iframe.

Please advise:

Here is my snippet of code.

Code: Select all

            var TabLink = ($('#registerIframeArtist').contents().find('#jsnamemsg').html() == '*Gender');
			//alert(TabLink);
			if(TabLink){
			 $('#tab-holder').hide();
			}
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to locate Iframe DIV id find and Hide..

Post by requinix »

Then you'd check whatever controls the visibility. Is it the entire #jsnamemsg that's hidden? Or a parent?

Either way you should be able to use :visible like

Code: Select all

var thing = $('$registerIframeArtist').contents().find('#jsnamemsg');
if(thing.html() == '*Gender' && thing.is(':visible')) {
    $('#tab-holder').hide();
}
danjapro
Forum Commoner
Posts: 72
Joined: Mon Sep 27, 2004 10:56 am

Re: how to locate Iframe DIV id find and Hide..

Post by danjapro »

Tried Several ways:

Code: Select all

				joms.jQuery("#registerIframeArtist").load(function(){
				var TabLink =  joms.jQuery(this).contents().find("#jsnamemsg").html();
				var getStyle = TabLink.match("visibility: hidden"); 
    			 if(joms.jQuery(getStyle == "visibility: hidden")) {
				    joms.jQuery('#tab-holder').show()
				 }
				 else {
				    joms.jQuery('#tab-holder').hide()
				 }
				});
I have placed alerts on getStyle, comes back with "NULL"..

I am lost
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to locate Iframe DIV id find and Hide..

Post by requinix »

Not the visibility, not the CSS. :visible. It's a special selector in jQuery that behaves specially.
danjapro
Forum Commoner
Posts: 72
Joined: Mon Sep 27, 2004 10:56 am

Re: how to locate Iframe DIV id find and Hide..

Post by danjapro »

Tried it with your method several way. Nothing worked.....

I appreciate your insight, but It needs to read as tag not variable (css tag) makes it easer, the .is(:visible), does not work well for later version of jquery.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: how to locate Iframe DIV id find and Hide..

Post by requinix »

So you did try it my way? What code did you use?
danjapro wrote:It needs to read as tag not variable (css tag) makes it easer
What?
danjapro wrote:the .is(:visible), does not work well for later version of jquery.
They added is() in 1.6 and the last time they touched :visible was 1.3 (for the better, I might add). How does it not work well/well enough?
danjapro
Forum Commoner
Posts: 72
Joined: Mon Sep 27, 2004 10:56 am

Re: how to locate Iframe DIV id find and Hide..

Post by danjapro »

Got it, thank you for everything you have done.

I got it working, had to re-write to fit my layout app needs, but you input was totally a big help.

Much, much, much thanks for all you coding assistance.

Fanhitz.com - check it out let us know what you think?

I ended up using
simply javascript iframe controller

Code: Select all

				joms.jQuery("#jsnamemsg").css("visibility","visible");
			    var tabs = window.parent.document.getElementById('tab-holder');
			     if(joms.jQuery(tabs)){
				   joms.jQuery(window.parent.document.getElementById('tab-holder')).hide();
				   joms.jQuery(window.parent.document.getElementById('fb_explain')).hide();
				   joms.jQuery(window.parent.document.getElementById('fb_connect_button')).hide();
				   joms.jQuery(window.parent.document.getElementById('fb_connect_button')).css('display','none !important');				   
				   joms.jQuery(window.parent.document.getElementById('oa_social_login_container')).hide();
				}
Post Reply