Wednesday, 21 August 2013

Run modalbox if in url is mysite.com/#newgoal

Run modalbox if in url is mysite.com/#newgoal

How to create if I have in my url:
mysite.com/#newgoal, my modalbox is displayed?
Currently is displayed if I click button with id="newGoalButton". I need
both options at once.
HTML:
<a href="#newgoal" id="newGoalButton">New Goal</a>
JS:
$(document).ready(function(){
$('#newGoalButton').click(function() {
$(".fullWhite").fadeIn(100);
$(".modal").fadeIn(200);
});
$('.modal .iks').click(function() {
$(".fullWhite").fadeOut(200);
$(".modal").fadeOut(100);
});
});

No comments:

Post a Comment