2017-04-08 39 views
0

有人可以建議我如何加載與URL的彈出我想要像pinterest網站(https://www.pinterest.com/)一樣。所以它可以幫助Facebook使用不同的URL評論。加載與不同的動態網址使用jQuery的彈出

我只是將參數追加到當前的URL,這不利於FB評論。

好吧,我加入我下面的代碼: 彈出代碼:

<a class="" href="/log/viewlist?id={{$data->id}}" data-target="#myModal" data-toggle="modal">My modal</a> 


<div id="myModal" class="modal fade"> 
<div class="modal-dialog"> 
    <div class="modal-content"> 
      <div class="modal-header"> 
       <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> 
       <h4 class="modal-title">Event Name</h4> 
      </div> 
      <div class="modal-body"> 
       <p>Details</p> 
      </div> 
      <div class="fb-comments" data-width="500"></div> 
      <div class="modal-footer"> 
       <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> 
      </div> 
    </div> 
</div> 

的Jquery:

$('#myModal').on('show.bs.modal', function (e) { 

    window.location.url = "/log/viewlist?id=" + $(this).attr('href'); 
    var url = $(this).attr('href'); 
    $('.fb-comments').attr('data-href',url); 

}); 

我的頁面加載與此,但Facebook的數據href是以此爲不同的網址,但該意見我在一個彈出窗口中顯示這些註釋出現在每一個模式中,但我想顯示僅爲該模式彈出窗口更新的註釋。

那麼有沒有其他的方式可以加載模式與URL可以採取單獨的Facebook評論。

請提出任何建議。謝謝 !

+1

你嘗試過這麼遠嗎? – Aj334

+0

所以不要提供代碼寫入服務,只要你自己努力就發佈它,如果你不能使它工作 – LGSon

+0

@LGSon:我已經添加了我的代碼,即時嘗試使其工作,但它不工作。我有任何想法! – 06011991

回答

0

您可以通過模糊背景然後設計前景來創建此效果。

.blur { 
 
    z-index: -1; 
 
    position: absolute; 
 
    left: 0; 
 
    right: 0; 
 
    top: 0; 
 
    bottom: 0; 
 
    -webkit-filter: blur(2px); 
 
    background: url(http://hackingui.com/wp-content/uploads/2014/05/meng2-1980x1000.jpg) no-repeat; 
 
    background-size: cover; 
 
} 
 

 
#fore { 
 
    font-weight:bold; 
 
    padding:10px; 
 
    background:white; 
 
    border:2px solid black; 
 
}
<div class="blur"> 
 
    <div id="back"> 
 
    filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text filler text 
 
    </div> 
 
</div> 
 

 
<div id="fore"> 
 
    Testing stuff 
 
</div>

+0

我不問這個效果。我只關心彈出窗口加載時的URL更改,以便它可以幫助我進行FB註釋插件集成,即使我在另一個彈出窗口應該出現的選項卡中單獨訪問URL。 – 06011991