我有这样的iframe:更改样式属性中单击
<iframe src="http://www.example.org" frameborder="0" style="top: -100; left: -250; width: 400; height: 590; border: 0; border:none;" scrolling="no" sandbox="allow-controls"></iframe>
我想它会自动更改 到:
<iframe src="http://www.example.org" frameborder="0" style="top: -200; left: -650; width: 950; height: 800; border: 0; border:none;" scrolling="no" sandbox="allow-controls"></iframe>
点击时。正是基本上我想改变top
,left
,width
和height
属性。
可能吗?如果是这样,怎么样?
是有可能使用JavaScript和@niceman你似乎是一个不错的人点击事件 – niceman
。你能告诉我如何证明它吗? – DingDangBang
你只需注册点击这里的事件:https://stackoverflow.com/questions/15080222/add-click-event-to-iframe,点击事件应改变使用jquery的'.css'的css(jquery是一个库JavaScript)或使用'.style'属性在这里:https://www.w3schools.com/js/js_htmldom_css.asp – niceman