2013-05-04 33 views
2

我想用onclick打开一个新的页面到颜色框。但问题是我已经在一个colorbox中,我需要发送一个参数到新的页面。用普通方法打开colorbox不起作用。我试过这个,但没有奏效。我该怎么办?(我需要从一个页面颜色框UUID发送到另一个页面也颜色框)从colorbox中打开新的colorbox并向其发送数据

function openAddCarBox(i) { 
var uuid = document.getElementsByName('uuid' + i).item(0).value; 
$("#colorbox").colorbox({ 
    iframe : true, 
    innerWidth : 500, 
    innerHeight : 300 
}); 
$('#colorbox').colorbox({ 
    href : 'vehicle.jsp?uuid=' + uuid, 
    title : '', 
    open : true 
}); 
} 
+0

http://stackoverflow.com/questions/8010413/jquery-colorbox-redirect-forward-inside-existing-colorbox – MoienGK 2013-05-04 13:15:05

回答

2

尝试使用IDS类,而不是用下面的方法。 即

$(document).on("click", ".colorbox", function(){ 
 
$.colorbox({ 
 
     href: $(this).data('url'), 
 
     iframe : true, 
 
     innerWidth : 500, 
 
     innerHeight : 300 
 
}); 
 
})
<a href="javascript:void(0);" data-url="Your Link with id" class="colorbox"></a>

相关问题