Notifications
Clear all

Hide elements in iframe - multiple items not working

4 Posts
3 Users
0 Reactions
1,086 Views
Posts: 1
Topic starter
(@willhug1791)
New Member
Joined: 4 years ago

according to the directions for Hide elements in iframe: "You can define several elements separated by , e.g. #header,h2"

i enter this in my shortcode: iframe_hide_elements=".update-nag,span#edit_controls,button#delete"

however in code view, the commas are being stripped out in the jquery, so it doesnt hide anything, this is what it has there instead:

aiModifyIframe_advanced_iframe_sticky() { try {jQuery('#advanced_iframe_sticky').contents().find('.update-nagspan#edit_controlsbutton#delete').css('display', 'none').css('width', '0').css('height','0');}

ive tried adding spaces after commas, double commas, etc.

3 Replies
TinyWebGallery
Posts: 923
Admin
(@admin)
Prominent Member
Joined: 16 years ago

Hi,

this is very strange. See

http://www.tinywebgallery.com/blog/advanced-iframe/demo-advanced-iframe-2-0

iframe_hide_elements=".twg_folderdescription,.topnavleft"

and the rendered code is:

jQuery('#advanced_iframe').contents().find('.twg_folderdescription,.topnavleft').css('display', 'none')

I also checked my code - the output is only html escaped

Do you have any other plugins which maybe remove this?

can you try also other features?  e.g.

hide_elements=".info,#sidebar,h2" 

and search for this in the code.

Best regards, Michael

 

 

 

Reply
Posts: 1
(@michael741)
New Member
Joined: 4 years ago

You can try this:

$('#iframeID').load(function(){
    $('#iframeID').contents().find('#leftpanel').hide();
    $('#iframeID').contents().find('#toppanel').hide();
});

Or:

$(document).ready(function(){
    $('#iframeID').contents().find('#leftpanel').hide();
    $('#iframeID').contents().find('#toppanel').hide();
});

This method is not possible if you want to work with different domains.

 
Reply
TinyWebGallery
Posts: 923
Admin
(@admin)
Prominent Member
Joined: 16 years ago

Both solutions would work. The more interesting thing is why "," disapear on this installation and not somewhere else. Unfortunately I did not get any feedback to look deeper into this.

Advanced iframe also supports this on remote domains if you can use the external workaround ;).

Best regards, Michael

 

Reply