這裏是我的代碼爲它有沒有辦法使用jQuery在新窗口中顯示圖像?
$(document).ready(function() {
$('#happymyleast').css('display', 'none');
});
$(document).ready(function() {
$('#reveal').click(function() {
window.open('testpage.html');
$('#happymyleast').show();
});
});
#happymyleast {
position: absolute;
top: 119px;
left: 71px;
height: 20px;
width: 20px;
background-color: #FFCC00;
border-radius: 10px;
}
<p id="happymyleast"></p>
<button id="reveal">Reveal</button>
當我點擊顯示按鈕,我想要的圖像或者說我已經建立了CSS的形狀是什麼,我希望做在另一個頁面上顯示。那是可以實現使用jQuery的東西嗎?
打開圖像很簡單 - 只需在圖像的URL處使用'window.open()'。 'css shape'是什麼意思? –
我在代碼中添加了window.open(),並且工作正常。如果我加入我已經建立的可能會更清晰的內容。 –
我將編輯我的問題,並以這種方式添加CSS,你可以看到我所做的。 –