2013-05-30 131 views
0

首先整個DIV看看這個小提琴http://jsfiddle.net/YrSzQ/在點擊打開單獨的頁面(新標籤)

基本上,我試圖做的就是添加這樣

<a target="_blank" href="here should be the event tile that you see at the first line of the fiddleel .html">open event</a> 

一個代碼,當我點擊打開的事件,我應該在新頁面中打開整個div。

看起來我正在回答這個問題,但我無法訪問該代碼,該代碼是通過文件獲取內容從遠程頁面檢索的代碼,並且我希望在我的頁面中回顯代碼之前添加此代碼

我希望你明白我試圖解釋

+0

的[添加內容到一個新打開的窗口]可能重複(http://stackoverflow.com/questions/10472927/add-content-to-a-new-open-window) – Mooseman

回答

0

不知道我理解你的權利,但如果你想打開一個新的窗口,與給定格的內容,你爲什麼不只需使用window.open並將現有div的內容添加到打開的窗口中,如下所述: Add content to a new open window

+0

不,我的意思是,讓我們解釋它換句話說,我有頁面,其中包含許多divs都像這樣在小提琴中我想廣告鏈接我每隔一個單獨的鏈接時它打開窗口包含此div只在新窗口div –

0

也許您正在尋找類似的東西?使用jQuery來識別單擊div內的鏈接時,然後執行javascript操作以在其自己的窗口中打開該div。

jsFiddle here

<html> 
    <head> 
     <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> 
     <script type="text/javascript"> 
      $(document).ready(function() { 
//alert('Document is ready'); 
       $('#newwindow a').click(function() { 
        alert('helloooooo'); 
       }); 

      }); 
     </script> 
    </head> 
<body> 

<div id="newwindow"> 
    <span class="lshevent">Li - Mattek-Sands (Court 1)</span>  
    <div id="event153341" class="lshjpane-slider lshcontent" style="padding-top: 0px; border-top-width: medium; border-top-style: none; padding-bottom: 0px; border-bottom-width: medium; border-bottom-style: none; overflow: hidden; height: 308px;"> 
     <table width="100%" class="insideslidebg" cellpadding="0" cellspacing="0" border="0"><tbody><tr><td colspan="2"><b>Live Streaming Video </b> <span class="section">Tennis</span> 
      <b>: </b> <span id="category754" class="category">Roland Garros 2013</span> 
     </td> 
    </tr></tbody></table></td> 


{ SNIP! } 


    </tr></tbody></table></div><!-- #event153341 --> 

</div><!--#newwindow--> 


</body> 
</html> 
+0

在你的小提琴中找不到任何東西,除非點擊任何鏈接時警告流行音樂說hellooooooo –

相關問題