-2

i need help with this script, it works when you click on the empty space, but when i click the script inside the div, the jquery function dont work, i need to make it work when i click on the script on the div get the div close by the cookie.

code in jsfiddle

http://jsfiddle.net/FcFW2/406/

potatopeelings
  • 40,709
  • 7
  • 95
  • 119
  • Which jQuery function? – Downgoat Apr 25 '15 at 20:55
  • when i click on the script inside the div this function dont work, only if i click outside of the script but in the div space `$('#popupDiv').click(function() { $('#popupDiv').hide(); createCookie('hide', true, 1) return false; ` – 4Safe Fatima Apr 25 '15 at 20:57

1 Answers1

0

Your script tag creates an iframe. Clicks in an iframe won't bubble up to the iframe's parent. You'd have to write the code in the iframe src link.

See capture click on div surrounding an iframe for a related question (your script tag basically inserts an iframe at the location)

Community
  • 1
  • 1
potatopeelings
  • 40,709
  • 7
  • 95
  • 119