我需要得到下面的JavaScript代碼以下任一環節的工作:我需要凝結這段JavaScript代碼
<a href="#" class="example1">http://example.com</a>
<a href="#" class="test">Doesnt work now</a>
被鏈接後顯示的代碼點:
<div style='display:none'>
<div id='example1' style='padding:10px; background:#fff;'>
<a href="http://example.com" target="_blank">Link</a>
</div>
</div>
的JavaScript代碼,我需要凝聚與任何類/ ID值,我給的工作:
<script>
$(document).ready(function(){
$(".example1").colorbox({width:"50%", inline:true, href:"#example1"});
$(".example2").colorbox({width:"50%", inline:true, href:"#example2"});
$(".example3").colorbox({width:"50%", inline:true, href:"#example3"});
$(".example4").colorbox({width:"50%", inline:true, href:"#example4"});
$(".example5").colorbox({width:"50%", inline:true, href:"#example5"});
});
您試圖編寫的代碼在哪裏?這看起來像是一個請我做我的家庭作業的問題。 –
您是否正在使用允許使用'.colorbox'的插件,或者是否有另一個未顯示的功能? –
這是在當前網站上運行。我只需要能夠在鏈接類中添加任何值並將其匹配到div id。 '.colorbox'是一個插件 – josh