小编Gop*_*pal的帖子

防止完全单击单选按钮

这一直困扰着我一段时间.我试图阻止用户点击单选按钮,具体取决于用户是否有权访问.第一个解决方案是执行以下操作:

没有残疾人

<input type="radio" name="my_radio1" id="abc1" value="5">
<input type="radio" name="my_radio1" id="abc2" value="0">
<input type="radio" name="my_radio1" id="abc3" value="1" checked>
Run Code Online (Sandbox Code Playgroud)

残疾人预选

<input type="radio" name="my_radio2" id="abc1" onclick="return false;" value="5">
<input type="radio" name="my_radio2" id="abc2" onclick="return false;" value="0">
<input type="radio" name="my_radio2" id="abc3" onclick="return false;" value="1" checked>
Run Code Online (Sandbox Code Playgroud)

有残疾人,没有预先选择

<input type="radio" name="my_radio3" id="abc1" onclick="return false;" value="5">
<input type="radio" name="my_radio3" id="abc2" onclick="return false;" value="0">
<input type="radio" name="my_radio3" id="abc3" onclick="return false;" value="1">
Run Code Online (Sandbox Code Playgroud)

如下所示:http://jsfiddle.net/93CqR/6/

这适用于ALREADY选中的单选按钮,但不适用于尚未检查的框(如上面的示例3所示).这有什么已知的解决方法吗?

Chrome和IE的行为与此不同

html javascript jquery

1
推荐指数
1
解决办法
442
查看次数

如何滑动到滑块上的特定幻灯片

我想使用网址将滑块滑动到特定的幻灯片.我可以使用幻灯片编号滑动到特定幻灯片,但我需要使用其ID滑动到它.

例如:如果我打开slider.html?pic=sunset它会将滑块滑动到幻灯片上id=slide

$(window).load(function () {
    $('#carousel').flexslider({
        animation: "slide",
        controlNav: false,
        animationLoop: false,
        slideshow: true,
        itemWidth: 210,
        itemMargin: 5,
        asNavFor: '#slider'
    });

    $('#slider').flexslider({
        animation: "slide",
        controlNav: false,
        animationLoop: false,
        slideshow: true,
        sync: "#carousel",
        start: function (slider) {
            $('body').removeClass('loading');
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

html jquery

1
推荐指数
1
解决办法
4283
查看次数

标签 统计

html ×2

jquery ×2

javascript ×1