Load all href images into a dialog Popup from Particular content

Step :Load the anchor tag href images into a dialog Popup

Need to include jquery.js, jquery-ui.js and jquery-ui.css

I have included like below.

<script src=”//code.jquery.com/jquery-1.10.2.js”></script>
<script src=”//code.jquery.com/ui/1.11.4/jquery-ui.js”></script>
<link href=”https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.css” rel=”stylesheet” type=”text/css” />

<script type="text/javascript">
 jQuery('.entry-content a').each(function() {
 var $link = $(this);
 var $dialog = jQuery('<img src="' + $link.attr('href') + '" />')
	.dialog({
		autoOpen: false,
		resizeable: false,
		modal: true,
		width: 1000,
		closeOnEscape: true,
		dialogClass: 'zoom',
		position: { my: 'top', at: 'top+2400' },
		zIndex: 9999
	 });
         $link.click(function() {
	$dialog.dialog('open');
	return false;
	});
 });
</script>

One thought on “Load all href images into a dialog Popup from Particular content”

Leave a Reply

Your email address will not be published. Required fields are marked *