javascript - jQuery Click() image -



javascript - jQuery Click() image -

why isn't click working

jquery:

$(document).ready(function(){ $('#slotclick').click(function(){ $(this).append('<div id=\"alertfade\"><div class=\"alert\">slotje<font style=\"float:right;\"><a href=\"#\" onclick=\"window.location.reload()\">x</a></font></div></div>'); }); $('#stickyclick').click(function(){ $(this).append('<div id=\"alertfade\"><div class=\"alert\">sticky<font style=\"float:right;\"><a href=\"#\" onclick=\"window.location.reload()\">x</a></font></div></div>'); }); });

html:

<img src="./../../assets/images/icons/slot.png" id="slotclick"> <img src="./../../assets/images/icons/sticky.png" id="stickyclick">

when clicks, has open alert window, done css! if click on image slot or sticky wont open

you can't append <div> <img>. if want add together after image clicked, wrap image in <div> , append onto that.

javascript jquery html

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -