How to highlight dates in JQM-DateBox calendar using javascript code

前端 未结 3 1353
面向向阳花
面向向阳花 2021-01-27 08:19

how to highlight cells in calendar with two different colors, i.e. some cells in RED and the others in GREEN .. using JavaScript

some code

javascr

3条回答
  •  野性不改
    2021-01-27 08:25

    As shown on this site: http://jquerymobile.com/demos/1.0rc4/docs/api/events.html there is an event called 'vmouseover' which stands a 'Normalized event for handling touch or mouseover events'.

    That is what you need, a possibility to change something on an event, which is in fact the mouseover (formerly known as hover).

    in Jquery 1.7 you could use

    $("#yourElement").on("vmouseover", function(event){
        $(this).css('color', 'green')
        $(this).css('background-color', 'red')
    });
    

    Apply this for your different elements in the calender and it should work.

    On(): http://api.jquery.com/on/

    Css(): http://api.jquery.com/css/

    and next time: provide some example code of what you already tried!!

    zY

提交回复
热议问题