I have a an iframe on my page that currentlyhas a background color of grey, I want to change the color to be white but cant seem to do it. I have tried using jquery but not sure if this is correct:
$(document).ready(function(){
$('iframe').contents().find('body').css('backgroundColor', 'white');
});
basically at the moment the bo tag within the iframe has the inline background-color: #f1f0e9
can anyone suggest how I can update this background color? i've tried css also but nothing.
The problem is on this page .html
The iframe is the booking element and the background color of this extends down the page because an iframe height had to be added to allow for all booking options to be shown when selected?
I have a an iframe on my page that currentlyhas a background color of grey, I want to change the color to be white but cant seem to do it. I have tried using jquery but not sure if this is correct:
$(document).ready(function(){
$('iframe').contents().find('body').css('backgroundColor', 'white');
});
basically at the moment the bo tag within the iframe has the inline background-color: #f1f0e9
can anyone suggest how I can update this background color? i've tried css also but nothing.
The problem is on this page http://cromorevillage./book.html
The iframe is the booking element and the background color of this extends down the page because an iframe height had to be added to allow for all booking options to be shown when selected?
Share Improve this question edited Jun 4, 2011 at 12:53 styler asked Jun 4, 2011 at 12:34 stylerstyler 16.5k25 gold badges85 silver badges139 bronze badges 2-
Does the
src
attribute of theiframe
have matching domain, protocol and port to its parent page? – alex Commented Jun 4, 2011 at 12:43 - @alex no the iftame is external – styler Commented Jun 4, 2011 at 12:51
3 Answers
Reset to default 2My ment...
Does the
src
attribute of theiframe
have matching domain, protocol and port to its parent page?
Your response...
No the
iframe
is external.
The reason you can not change it is because of Same Origin Policy.
$(document).ready(function(){
$('iframe').contents().find('body').attr('bgcolor', 'white');
});
.css('background-color', 'white');
background-color
is the css style you are looking for.
You need to add a P3P
header with the value of CP="CAO PSA OUR"
to allow cross-domain interfacing.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745301597a4621466.html
评论列表(0条)