You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i got to fire the click event. the thing is you must have no other html element overlaying your maximage container. and you should use the jquery live event because the plugin transforms your images to divs on the fly
you should use jquery like this
$('#maximage').on('click', '.mc-image', function() {
console.log($(this).data()) // will log all data attr
});
now because maximage transforms your images to divs with background images; if you have other containers laying on top of your maximage div, you wont be able to click on the mc-image because it is blocked by the container on top and unfortunately you cant z-index your maximage container to be above everything else otherwise you will only see images
I've add data-href values to my images. They are applied to the .mc-image div.
However I cannot bind a onclick event on the div.
I've added in the document ready:
$('.mc-image').click(function() {
console.log('working?'); // For testing
});
But no 'working?' in the firebug console.
Also not working:
$('.mc-image').each(function() {
$(this).attr('onclick', 'console.log("working?");');
});
The onclick attribute is added when I inspect the element with Firebug but still no action.
What is the way to add onclick to the div/image?
The text was updated successfully, but these errors were encountered: