Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9198697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:20:51+00:00 2026-06-17T22:20:51+00:00

I’m currently working with a jQuery ui datepicker and I’m trying to figure out

  • 0

I’m currently working with a jQuery ui datepicker and I’m trying to figure out if it is at all possible to combine the calendar with the isotope plugin, more specifically the data-filter, i.e. selecting a date from the datepicker and filtering out the relevant events (on that date).
Here’s some of my html:

<div id="datepicker"></div>

<div id="block-wrap">
    <div class="blocks">1</div>
    <div class="blocks">3</div>
    <div class="blocks">2</div>
    <div class="blocks">2</div>
    <div class="blocks">3</div>
    <div class="blocks">1</div>
    <div class="blocks">3</div>
    <div class="blocks">2</div>
    <div class="blocks">1</div>    
</div>

Also a working demo on jsfiddle here too
So is it at all possible to filter out the numbered blocks using the datepicker?
Any help would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T22:20:52+00:00Added an answer on June 17, 2026 at 10:20 pm

    I did look at this again.

    You can use the datepicker’s onSelect() method and attach this:

    onSelect: function (dateText, inst) {
      var date = $(this).datepicker('getDate');
      //var dayValue = date.getDate(); // or
       var dayValue = inst.selectedDay;
    
    
      $blocks.show();
    
      $blocks.filter(function () {
        if (this.innerHTML != dayValue) {
          $(this).hide();
        }
      });
    }
    

    You can use the first function parameter which holds a string version of the date you clicked or you can use the second parameter which is an instance of the datepicker object with useful properties values for the date elements.


    DEMO 01 – Only show boxes matching the number clicked in calendar


    I had a play around and the filter option of the isotop must be a selector. As far as I know you cannot generate a jQuery selector interrogation the value or innerHTML.

    However, you can add a custom attribute to each block containing the same value, similar to this:

    <div class="blocks" data-value="1">1</div>
    <div class="blocks" data-value="3">3</div>
    <div class="blocks" data-value="2">2</div>
    

    Now, you can generate a valid selector for the filter in the OnSelect method of the datepicker, like this:

    onSelect: function (dateText, inst) {
      var date = $(this).datepicker('getDate');
      var dayValue = inst.selectedDay;
    
      $container.isotope({
        filter: '[data-value="' + dayValue + '"]'
      });
    }
    

    DEMO 02 – Using data attributes to connect datepicker to isotope filter


    Code from the DEMOs in case of link-rot:


    DEMO-01: HTML

    <div id="datepicker"></div>
    <div id="block-wrap">
      <div class="blocks">1</div>
      <div class="blocks">3</div>
      <div class="blocks">2</div>
      <div class="blocks">2</div>
    </div>
    

    DEMO-01: Script

    var $blocks = $("div.blocks", "#block-wrap");
    
    $(function () {
      $('#datepicker').datepicker({
        inline: true,
        //nextText: '&rarr;',
        //prevText: '&larr;',
        showOtherMonths: true,
        //dateFormat: 'dd MM yy',
        dayNamesMin: ['S', 'M', 'T', 'W', 'T', 'F', 'S'],
        //showOn: "button",
        //buttonImage: "img/calendar-blue.png",
        //buttonImageOnly: true,
        onSelect: function (dateText, inst) {
          var date = $(this).datepicker('getDate');
          var dayValue = date.getDate();
    
          $blocks.show();
    
          $blocks.filter(function () {
            if (this.innerHTML != dayValue) {
              $(this).hide();
            }
          });
        }
      });
    });
    
    
    var $container = $('#block-wrap');
    
    $container.imagesLoaded(function () {
      $container.isotope({
        itemSelector: '.blocks',
        animationEngine: 'css',
        masonry: {
          columnWidth: 5
        }
    
    
      });
    });
    

    DEMO-02: HTML

    <div id="datepicker"></div>
    <div id="block-wrap">
      <div class="blocks" data-value="1">1</div>
      <div class="blocks" data-value="3">3</div>
      <div class="blocks" data-value="2">2</div>
      <div class="blocks" data-value="2">2</div>
      <div class="blocks" data-value="1">1</div>
    </div>
    

    DEMO 02 – Script (only onSelect changed when compared to DEMO 01 script)

    onSelect: function (dateText, inst) {
      var date = $(this).datepicker('getDate');
      var dayValue = inst.selectedDay;
      $container.isotope({
        filter: '[data-value="' + dayValue + '"]'
      });
    }
    

    CSS same for both DEMOs

    #datepicker {
      position: absolute;
      left: 5px;
      top: 5px;
      z-index: 9999;
    }
    #block-wrap {
      position: absolute;
      padding-left: 230px;
      top: 10px;
      width: auto;
    }
    .blocks {
      position: relative;
      width: 40px;
      height: 40px;
      background-color: silver;
      float: left;
      margin-right: 5px;
      margin-bottom: 5px;
    }
    .isotope-item {
      z-index: 2;
    }
    .isotope-hidden.isotope-item {
      z-index: 1;
    }
    .isotope, .isotope .isotope-item {
      /* change duration value to whatever you like */
      -webkit-transition-duration: 0.5s;
      -moz-transition-duration: 0.5s;
      -ms-transition-duration: 0.5s;
      -o-transition-duration: 0.5s;
      transition-duration: 0.5s;
    }
    .isotope {
      -webkit-transition-property: height, width;
      -moz-transition-property: height, width;
      -ms-transition-property: height, width;
      -o-transition-property: height, width;
      transition-property: height, width;
    }
    .isotope .isotope-item {
      -webkit-transition-property: -webkit-transform, opacity;
      -moz-transition-property: -moz-transform, opacity;
      -ms-transition-property: -ms-transform, opacity;
      -o-transition-property: -o-transform, opacity;
      transition-property: transform, opacity;
    }
    /**** disabling Isotope CSS3 transitions ****/
     .isotope.no-transition, .isotope.no-transition .isotope-item, .isotope .isotope-item.no-transition {
      -webkit-transition-duration: 0s;
      -moz-transition-duration: 0s;
      -ms-transition-duration: 0s;
      -o-transition-duration: 0s;
      transition-duration: 0s;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a text area in my form which accepts all possible characters from
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.