这是页面标题中的代码:
<script src='https://terminal.jup.ag/main-v3.js'></script>
小部件的代码片段作为代码块插入到页面上:
<div style="width: 100%; margin: 0 auto;">
<div id="integrated-terminal"></div>
<script>
window.Jupiter.init({
displayMode: "integrated",
integratedTargetId: "integrated-terminal",
endpoint: "https://api.mainnet-beta.solana.com",
formProps: {
fixedOutputMint: true,
swapMode: "ExactIn",
initialOutputMint: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
},
});
</script>
</div>
我尝试更改 div 样式,将其完全删除,更改部分宽度。
JS Fiddle 上测试了你的代码,它似乎运行良好。即使代码在本地运行也能按预期工作。
您可以尝试的一件事是设置max-width: x; 属性:
<script src='https://terminal.jup.ag/main-v3.js'></script>
<div style="width: 100%; max-width: 100%; margin: 0 auto;">
<div id="integrated-terminal"></div>
<script>
window.Jupiter.init({
displayMode: "integrated",
integratedTargetId: "integrated-terminal",
endpoint: "https://api.mainnet-beta.solana.com",
formProps: {
fixedOutputMint: true,
swapMode: "ExactIn",
initialOutputMint: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
},
});
</script>
</div>