dongwen2162 2018-10-12 09:58
浏览 36

如何使用rateYo插件的键盘事件(左,右箭头)

I am using rateYo plugin for rating and i want to select the rate from keyboard up and down arrows instead of mouse hover and select ,can any have a solution ?

 $(".rateYo").rateYo({
        starWidth: "40px",
        normalFill: "#8c8c8c",
        ratedFill: "#f57c00",
        fullStar: !0,
        onSet: function(rating, rateYoInstance) {
            $(".jq-ry-rated-group.jq-ry-group").children().eq(rating - 1).addClass('blink');
            if (category.user_info_location == 1) {
                var language = $("#userDetailsForm select").val()
            } else {
                language = $("#welcome select").val()
            }
            if (language == 1) {
                var parentDiv = "#question"
            } else if (datas.selected_language) {
                $.each(datas.selected_language, function() {
                    var lang_lower = this.name.toLowerCase();
                    var id = this.id;
                    if (Ques[0].language_question[lang_lower]) {
                        if (language == id) {
                            parentDiv = "#" + lang_lower + "_questions"
                        }
                    }
                })
            }
            $("" + parentDiv + " .Wallop-item.Wallop-item--current").children('input.answer_rating').val(rating);
            if (parseInt($("#pageCount").text()) == parseInt($("#totalpage").text())) {
                $("#end").click()
            } else if (parseInt($("#pageCount").text()) < parseInt($("#totalpage").text())) {
                $("#right").click()
            }
        }
    });
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
    • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
    • ¥15 划分vlan后,链路不通了?
    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)