I am trying to create a modal popup for a summary web part on sharepoint. The following code below works, but I want to only have a modal for certain items in the list. Currently, because of "dfwp-list" it opens every item in modal. Please assist?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
<script>
function openDialog(pageUrl) {
var options = {
url: pageUrl,
title: '',
allowMaximize: false,
showClose: true,
width: 500,
height: 500
};
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
$(".dfwp-list").click(function(e) {
openDialog(e.target.href);
//$(".dfwp-list").removeAttr('href');
return false;
});
</script>