Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery Tumblr照片集_Jquery_Tumblr - Fatal编程技术网

Jquery Tumblr照片集

Jquery Tumblr照片集,jquery,tumblr,Jquery,Tumblr,我正试图侵入tumblr photoset,我想我找到了一个最大700显示尺寸的修复程序 假设这是由{Photoset-700}生成的正常iframe: <iframe class="photoset" scrolling="no" frameborder="0" height="1048" width="700" style="border:0px; background-color:transparent; overflow:hidden;" src="http://www.georg

我正试图侵入tumblr photoset,我想我找到了一个最大700显示尺寸的修复程序

假设这是由{Photoset-700}生成的正常iframe:

<iframe class="photoset" scrolling="no" frameborder="0" height="1048" width="700" style="border:0px; background-color:transparent; overflow:hidden;" src="http://www.georgefratila.ro/post/20314734048/photoset_iframe/esssk/tumblr_m1tp5634Si1qzc7t7/700/false"></iframe>

我现在唯一的问题是高度,它不适合iframe。

我已经找到了解决问题的方法,这里是:

//This will change the source address and display the correct size.

        $(".photoset").each(function() { 
    var newSrc = $(this).attr("src").replace('700','860');
    $(this).attr("src", newSrc);       
}); 
//This will get the new size of the iframe and resize the iframe holder accordingly.

$(function(){
var iFrames = $('.photoset');
function iResize() {
    for (var i = 0, j = iFrames.length; i < j; i++) {
        iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';}
    }

    if ($.browser.safari || $.browser.opera) { 
        iFrames.load(function(){
            setTimeout(iResize, 0); 
        });

        for (var i = 0, j = iFrames.length; i < j; i++) {
            var iSource = iFrames[i].src;
            iFrames[i].src = '';
            iFrames[i].src = iSource;
        }
    } else {
        iFrames.load(function() {
            this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
        });
    }
});
//这将更改源地址并显示正确的大小。
$(“.photoset”).each(function(){
var newSrc=$(this.attr(“src”).replace('700','860');
$(this.attr(“src”,newSrc);
}); 
//这将获得iframe的新尺寸,并相应地调整iframe支架的大小。
$(函数(){
变量iFrames=$('.photoset');
函数iResize(){
对于(变量i=0,j=iFrames.length;i

如果您对如何最小化或改进脚本有任何想法,请在下面发布。享受

我已经找到了解决问题的方法,这里是:

//This will change the source address and display the correct size.

        $(".photoset").each(function() { 
    var newSrc = $(this).attr("src").replace('700','860');
    $(this).attr("src", newSrc);       
}); 
//This will get the new size of the iframe and resize the iframe holder accordingly.

$(function(){
var iFrames = $('.photoset');
function iResize() {
    for (var i = 0, j = iFrames.length; i < j; i++) {
        iFrames[i].style.height = iFrames[i].contentWindow.document.body.offsetHeight + 'px';}
    }

    if ($.browser.safari || $.browser.opera) { 
        iFrames.load(function(){
            setTimeout(iResize, 0); 
        });

        for (var i = 0, j = iFrames.length; i < j; i++) {
            var iSource = iFrames[i].src;
            iFrames[i].src = '';
            iFrames[i].src = iSource;
        }
    } else {
        iFrames.load(function() {
            this.style.height = this.contentWindow.document.body.offsetHeight + 'px';
        });
    }
});
//这将更改源地址并显示正确的大小。
$(“.photoset”).each(function(){
var newSrc=$(this.attr(“src”).replace('700','860');
$(this.attr(“src”,newSrc);
}); 
//这将获得iframe的新尺寸,并相应地调整iframe支架的大小。
$(函数(){
变量iFrames=$('.photoset');
函数iResize(){
对于(变量i=0,j=iFrames.length;i

如果您对如何最小化或改进脚本有任何想法,请在下面发布。享受

这似乎发生了很多。我开发了一个jQuery插件,它可以使Tumblr Photosets完全响应,并且可以达到您设置的容器宽度


我更喜欢这样,而不是摆弄iFrame的大小,因为您可以获得更多信息(包括EXIF数据),并且可以完全控制内容。

这似乎出现了很多问题。我开发了一个jQuery插件,它可以使Tumblr Photosets完全响应,并且可以达到您设置的容器宽度

我更喜欢这一点,而不是摆弄iFrame的大小,因为您可以获得更多信息(包括EXIF数据),并且可以完全控制内容