我正在尝试将iframe height参数更改为iframe中加载的页面的相同px.在iframe中加载的页面来自另一个域.
将在iframe内部加载不同的页面,从而导致iframe内容的高度发生变化,因此我需要获取iframe内容高度并将其应用于iframe height参数.
这是我正在谈论的一个例子:http://jsfiddle.net/R7Yz9/3/
<div class="site"><a href="http://amazon.com/" target="_top">Amazon </a></div>
<div class="site"><a href="http://cnn.com/" target="_top">Cnn </a></div>
<div class="site"><a href="http://wikipedia.org/" target="_top">Wikipedia </a></div>
<iframe id="source" src="http://amazon.com/" frameborder="0" scrolling="no" width="100%" height="100%"></iframe>
Run Code Online (Sandbox Code Playgroud)
.
$(document).ready(function() {
var iframe = $( "#source" );
$( "a[target=_top]" ).click( function(){
iframe.attr( "src", this.href );
return false;
});
});
Run Code Online (Sandbox Code Playgroud) 我试图制作一个从彩色到灰度的图像在颜色和灰度之间的交汇点处有淡化或平滑的东西而不是尖锐的线条.
这就是我所拥有的:http://jsfiddle.net/gmU9y/104/
<div class="image-container">
<img class="image-grey" src="http://wallpapernesia.com/wp-content/uploads/2014/12/colorful_wallpaper_45_backgrounds-1024x576.jpg" />
</div>
.image-container {
position:relative;
display:inline-block;
}
.image-grey {
display:block;
-webkit-filter: grayscale(100%);
filter: grayscale(100%);
}
.image-container:after {
background-image: url("http://wallpapernesia.com/wp-content/uploads/2014/12/colorful_wallpaper_45_backgrounds-1024x576.jpg");
content: "";
height: 30%;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
Run Code Online (Sandbox Code Playgroud)
(注意颜色和灰度之间的汇合处有一条尖锐的线)
我需要它看起来更像这样:
我真的需要帮助,任何意见或建议将不胜感激.谢谢
我试图在我的帖子中过滤掉iframe,我的帖子看起来像这样
<!--videoplayer--><iframe title="YouTube video player" class="youtube-player" type="text/html" width="200" height="200" src="http://www.youtube.com/embed/IIYeKGNNNf4?rel=0" frameborder="0" allowFullScreen></iframe><!--endvideoplayer-->Blitz performs at Desifest 2010 in Toronto Canada, & Films music video with Navin Kundra for the song "Love You The Same" feat Kat Eyez & produced by Roach Killa from Blitz's new album "Get Blitz". Join my fanpage for more: WWW.FACEBOOK.COM/BLITZMUSIC *Special thanks to: Deesha, Dj Jump Off, Paul The Drummer, Surgeon, Umar, Navin Kundra, Nyrone, Sats B, Kat Eyez, B Don. (New Album Coming Soon!)
Run Code Online (Sandbox Code Playgroud)
我只想返回iframe而不是帖子描述,所以从我想要的.
谢谢
我有一个问题,似乎无法找到它的生命,因为我的代码适用于除IE7之外的所有其他浏览器.这是我得到"预期的标识符,字符串或数字"的错误
这是我的代码.
function calculate() {
var principal = document.loandata.principal.value;
var interest = document.loandata.interest.value / 100 / 12;
var payments = document.loandata.years.value * 12;
var x = Math.pow(1 + interest, payments);
var monthly = (principal*x*interest)/(x-1);
if (!isNaN(monthly) &&
(monthly != Number.POSITIVE_INFINITY) &&
(monthly != Number.NEGATIVE_INFINITY)) {
document.loandata.payment.value = round(monthly);
document.loandata.total.value = round(monthly * payments);
document.loandata.totalinterest.value =
round((monthly * payments) - principal);
} else {
document.loandata.payment.value = "";
document.loandata.total.value = "";
document.loandata.totalinterest.value = "";
}
}
function round(x) {
return Math.round(x*100)/100;
} …Run Code Online (Sandbox Code Playgroud) 我试图将一个变量传递到谷歌图表中,但是当我这样做时图表停止显示,我的目标是每次我在输入字段中输入不同的数字时图表都会改变,但我现在无处可去. 这就是我所拥有的,有人可以就我做错了什么提供一些指导吗?
Javascript
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', {packages: ['corechart']});
</script>
<script type="text/javascript">
function numbers(){
var work_field = document.forms['work_form']['work_n_field'].value;
var work_div = document.getElementById('number-work');
var numberschart = work_div.innerHTML = work_field;
return false;
};
function drawVisualization() {
// Create and populate the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Task');
data.addColumn('number', 'Hours per Day');
data.addRows(5);
data.setValue(0, 0, 'Work');
//Right here is where I pass my variable into the chart
data.setValue(0, 1, numberschart);
//And I leave the rest here until …Run Code Online (Sandbox Code Playgroud)