So, I am working on a project for a recreational cannabis retailer. It's a splash page promotional website (one page, uses jQuery to fade into full screen video), and I have it pretty much all finished. You go to the URL, and are prompted to "ENTER" so long as you are of age.
The law here requires that we verify the person entering the site is aged 21+ via checkbox, which I have also accomplished, however now I can't figure out how to make my jQuery function execute correctly after the checkbox requirement is validated.
Here is my HTML:
<div id="splash">
<div class="checkbox-group required">
<Br />
<form>
<input type="checkbox" name="age" id="age" required> I am 21
years of age or older<Br /><Br />
<input type="checkbox" name="alien" id="alien" required> I am not an alien
<input type="image" src="img/enter.png" id="enter">
</form>
</div>
<img src="img/ufo2.jpg">
</div>
My JS:
if(form.checkbox.checked) {
$( "#enter" ).click(function() {
$( "#splash" ).fadeOut( "slow" );
});
$( "#enter" ).click(function() {
$( "#post-splash" ).fadeIn( "slow" );
});
}
I've a feeling it has something to do with my event method but I'm not familiar enough with JS yet to crack it. Thanks!
Aucun commentaire:
Enregistrer un commentaire