簡體   English   中英

在同一頁面上鏈接另一個html(javascript)

[英]link another html on the same page (javascript)

我想在此CSS彈出框頂部的同一頁面上鏈接另一個html(nytimes.html)。 我怎么做?

$('.portfolio-thumbnail').click(function(e) {
console.log(this.id); //this is how we know what to load into the frame
$('#popup-frame').fadeIn();

switch(this.id) {
case "nytimes":
    //do something for nytimes
    $('#popup-frame').css('background', "rgba(0, 255,0, .5)" );


    break;
case "eloquence":
    $('#popup-frame').css('background', "rgba(255, 82, 145, .5)" );
    break;
default:
    break;
}
});

我個人建議您將一個iFrame嵌入到您要顯示的網站內的CSS彈出窗口中。

case "nytimes":
    //do something for nytimes
    $('#popup-frame').css('background', "rgba(0, 255,0, .5)" );

    $('#popup-frame').html('<iframe src="nytimes.html" name="popupFrame" scrolling="auto" frameborder="no" align="center" height = "100%" width = "100%"> </iframe>')
    break;

然后,您可以對iFrame進行樣式設置,以顯示所需的樣式,包括在iframe中使用css zoom屬性來使內容看起來更小(如果您想放慢頁面的“預覽”速度)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM