Page 1 of 1
how to locate Iframe DIV id find and Hide..
Posted: Mon Jun 24, 2013 11:31 am
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();
}
Re: how to locate Iframe DIV id find and Hide..
Posted: Mon Jun 24, 2013 3:43 pm
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();
}
Re: how to locate Iframe DIV id find and Hide..
Posted: Tue Jun 25, 2013 11:47 am
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
Re: how to locate Iframe DIV id find and Hide..
Posted: Tue Jun 25, 2013 12:26 pm
by requinix
Not the visibility, not the CSS.
:visible. It's a special selector in jQuery that behaves specially.
Re: how to locate Iframe DIV id find and Hide..
Posted: Tue Jun 25, 2013 1:55 pm
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.
Re: how to locate Iframe DIV id find and Hide..
Posted: Tue Jun 25, 2013 4:29 pm
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?
Re: how to locate Iframe DIV id find and Hide..
Posted: Wed Jun 26, 2013 7:56 am
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();
}