简体   繁体   English

iframe仅显示网站的特定部分,而不会滚动

[英]Iframe to show only a specific part of a website with no scroll

I'm trying to set up an iframe and want to only show a certain part of a page with no scroll but I'm having trouble getting the width height and margins right. 我正在尝试设置一个iframe,并且只想显示页面的某个部分而没有滚动显示,但是我无法正确设置宽度和边距。

Webpage I want to show a certain part of: https://stellarchain.io/address/GB3O3S72Y2D25EK2BSA7VBJB5BXIAIKJZF4WIMEIQSB53TEIOIADT76L 我想显示以下内容的网页: https : //stellarchain.io/address/GB3O3S72Y2D25EK2BSA7VBJB5BXIAIKJZF4WIMEIQSB53TEIOIADT76L

Here is a snippet of what I want: Just the balance and 2,984,000,000 这是我想要的代码片段: 仅余额和29.84亿

This is the code I found and tried using: 这是我找到并尝试使用的代码:

    <div style="border: 1px solid rgb(201, 0, 1); overflow: hidden; margin: 15px auto; max-width: 736px;"> 
<iframe scrolling="no" src="" style="border: 0px none; margin-left: -185px; height: 859px; margin-top: -533px; width: 926px;"> 
</iframe> 
</div>

Any Help will be appreciated! 任何帮助将不胜感激! Thank you. 谢谢。

As a way to solve your problem, you can use this code: 作为解决问题的一种方法,可以使用以下代码:

 #outerdiv { width:200px; height:75px; overflow:hidden; position:relative; } #innerIframe { position:absolute; top:-370px; left:-1050px; width:1300px; height:1450px; } 
 <div id="outerdiv"> <iframe src="https://stellarchain.io/address/GB3O3S72Y2D25EK2BSA7VBJB5BXIAIKJZF4WIMEIQSB53TEIOIADT76L" id="innerIframe" scrolling="no"></iframe> </div> 

An alternate way is in JQuery 另一种方法是在JQuery中
if same origin policy is not making issue) 如果相同来源政策没有问题)

$('#contentDIV').load('https://stellarchain.io/address/GB3O3S72Y2D25EK2BSA7VBJB5BXIAIKJZF4WIMEIQSB53TEIOIADT76L#targetDiv');

replace #targetDiv from URL with the div area you want to load in your page. 将URL中的#targetDiv替换为要在页面中加载的div区域。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM