Message Boards

popup on button click and image click

thumbnail
akash rathod, modified 12 Years ago.

popup on button click and image click

New Member Posts: 22 Join Date: 10/6/11 Recent Posts
hi. everybody

i use button on click for calling popup..it's working
 <button id="akash">Show All</button>


but for image it not work
<img src="<%= sht %>" height="50%" width="50%" onclick="akash">


my script for popup is
AUI().ready('aui-dialog', function(A) {

	A.one('#akash').on('click', function() {
		var scrt="/html/12812.jpg";
		
		var html='<img src="/html/12812.jpg"> ';
		var dialog2 = new A.Dialog(
				{
					header: 'display image',
					title: 'Dialog',
					bodyContent:html,
					position:'center',
					modal:true,
					
					xy: ['center', 100],
					
				}
				
			).render();

	});	
	});

what is a problem? plz help me
thumbnail
Hitoshi Ozawa, modified 12 Years ago.

RE: popup on button click and image click

Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Not sure on what you're trying to do.

In your button, you've set id.
<button id="akash">


In you img, you set a function call.
<img src="<%= sht %>" height="50%" width="50%" onclick="akash"/>

In your javascript, you're executing on a event click on id.
A.one('#akash').on('click', function() {

Simply by looking, have you tried setting id on your img tag instead of onclick?
<div id="akash"><img src="<%= sht %>" height="50%" width="50%" /></div>