Dear community, I ask your help, did here’s a crutch, it is strange that a modal window with the content does not appear, probably out of the scope of a frame, locally it works. The question is, how to make so that my window is not already appear if a user has a cook. I can not figure out how to add the if(){}. Seems to do everything right. And yet, after adding the conditions, in the firebag the entry error: Uncaught ReferenceError: getCookieValue is not defined
But this design does not work (location in the body):
<script type="text/javascript">
$(document).ready(function() {
var getCookieValue = $.cookie("visit");
if (getCookieValue == true) {
$("a.gallery2").fancybox(
{
"padding" : 20,
"imageScale" : false,
"zoomOpacity" : false,
"zoomSpeedIn" : 1000,
"zoomSpeedOut" : 1000,
"zoomSpeedChange" : 1000,
"frameWidth" : 700,
"frameHeight" : 600,
"overlayShow" : true,
"overlayOpacity" : 0.8,
"hideOnContentClick" :false,
"centerOnScroll" : false
}).click();
}
});
</script>
It is not clear to me whether you want to show fancybox only when the cookie is
trueor not. Assuming that fancybox should be shown only if the cookie value istrue, then try thisIn this case, the fancybox won’t be shown during the first visit but always after the second while the cookie is valid.
On the other hand, if fancybox should be shown during the first visit only, then try :
In both examples, it’s assumed that you have this html somewhere in your code: