Notifications
Clear all

How do I change the menu color?

4 Posts
3 Users
0 Reactions
666 Views
Posts: 5
Topic starter
(@warwick)
Active Member
Joined: 4 years ago

Hi, My IFrames pro is working well, I now want to be able to change the color of the menu tabs to match my site theme theme. How do I do that, for example to change the default blue to a red. Thanks for your help

3 Replies
2 Replies
(@deckow)
Joined: 4 years ago

New Member
Posts: 1
Posted by: @warwick

Hi, My IFrames pro is working well, I now want to be able to change the color of the menu tabs to match my site theme theme. How do I do that, for example to change the default blue to a red. Thanks for your help

If no and the iframe is external, then reason you can not change it is because of Same Origin Policy.

If yes, then you can add <body> to the iframe and use this

$(document).ready(function(){
    $('iframe').contents().find('body').css('backgroundColor', 'Your Color');
});

So your code will be

<html>
<body>
<style type="text/css">
iframe {
    background-color: #F00;
}
</style>
<iframe src="http://www.filehippo.com/" height="100%" width="100%"></iframe>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
    $('iframe').contents().find('body').css('backgroundColor', 'white');
});
</script>
</body>
</html>

 

Reply
TinyWebGallery
Admin
(@admin)
Joined: 16 years ago

Prominent Member
Posts: 923

@deckow My plugin does support changing elements on the same domain out of the box. This can be simply configured in the shortcode. It also supports the cross domain of you can use the external workaround. This is why I below asked for the setup...

Best regards, Michael

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

How is your setup?

Please check this howto: http://www.tinywebgallery.com/blog/forum/advanced-iframe-faq/how-can-i-show-only-a-part-of-the-page-in-the-iframe

Hiding an element or changing a color need the same setup.

Best regards,

Michael

Reply