2013-05-30 70 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 –

相关问题