Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

jQuery Canlendar click function

I am using a Wordpress Plugin called bookly.  It is at the very bottom of the page.  If you go there and click on a date, the next step appears and you can choose a time.

However, if you go to the calendar when you first load the page, then navigate to the next month and click on the calendar date, the next step does not happen.
http://0c8.88c.myftpupload (DOT) com/

This is what controls it showing.
<script>
var int = setInterval(function() {
    if ($('#footer-calendar').find('.picker__day').length > 0) {
        clearInterval(int);
        init_calendar();
    }
}, 100);

function init_calendar() {
    $('.picker__day').on("click", function(e) {
        $('#footer-calendar').addClass('calendarstart');
    });

}

Open in new window

Avatar of leakim971
leakim971
Flag of Guadeloupe image

work for me... desktop and mobile...
question incomplete ?
User generated imageUser generated image
No, it doesn't, if you at first switch month (to December from November), after that times div not receiving  display:block rule.
It is something to do with this part: wp-content/themes/inspyrus/library/js/scripts.js
function init_calendar() {
    $('.picker__table').on("click", function(e) {
        $('#footer-calendar').addClass('calendarstart');
    });

}

    $('.picker__table').on("click", function(e) {
        $('#footer-calendar').addClass('calendarstart');
    });

Open in new window

For some reason it doesn't work after you change month. Sorry, need to go.
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So did you put the code on your site and it work fine but no feedback from you...

by the way you don't need this code anymore... that's why I put my line 1 in my previosu answer.
/* Footer Calendar */
var int = setInterval(function() {
    if ($('#footer-calendar').find('.picker__day').length > 0) {
        clearInterval(int);
        init_calendar();
    }
}, 100);

Open in new window