提交 dbe9d8c5 编写于 作者: Y Yu Yang

Fix bugs in link inside iframe

上级 300f36f1
...@@ -127,6 +127,10 @@ ...@@ -127,6 +127,10 @@
$('#content_iframe').on('load', function(){ $('#content_iframe').on('load', function(){
$("#content_iframe").height(200) // trick code to shrink iframe size $("#content_iframe").height(200) // trick code to shrink iframe size
$("#content_iframe").height($('#content_iframe').contents().find("body").height()+20) $("#content_iframe").height($('#content_iframe').contents().find("body").height()+20)
var alllinks = $('#content_iframe').contents().find("a")
for (var i =0; i<alllinks.length; ++i) {
alllinks[i].setAttribute("target", "_blank")
}
}); });
</script> </script>
</body> </body>
......
...@@ -127,6 +127,10 @@ ...@@ -127,6 +127,10 @@
$('#content_iframe').on('load', function(){ $('#content_iframe').on('load', function(){
$("#content_iframe").height(200) // trick code to shrink iframe size $("#content_iframe").height(200) // trick code to shrink iframe size
$("#content_iframe").height($('#content_iframe').contents().find("body").height()+20) $("#content_iframe").height($('#content_iframe').contents().find("body").height()+20)
var alllinks = $('#content_iframe').contents().find("a")
for (var i =0; i<alllinks.length; ++i) {
alllinks[i].setAttribute("target", "_blank")
}
}); });
</script> </script>
</body> </body>
......
...@@ -99,6 +99,10 @@ ...@@ -99,6 +99,10 @@
$('#content_iframe').on('load', function(){ $('#content_iframe').on('load', function(){
$("#content_iframe").height(200) // trick code to shrink iframe size $("#content_iframe").height(200) // trick code to shrink iframe size
$("#content_iframe").height($('#content_iframe').contents().find("body").height()+20) $("#content_iframe").height($('#content_iframe').contents().find("body").height()+20)
var alllinks = $('#content_iframe').contents().find("a")
for (var i =0; i<alllinks.length; ++i) {
alllinks[i].setAttribute("target", "_blank")
}
}); });
</script> </script>
</body> </body>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册