English 中文(简体)
是否能够将参数传给一个小公司。
原标题:Is it possible to pass parameters to a jQuery UI slider
  • 时间:2012-04-10 01:29:40
  •  标签:
  • jquery

我正试图建造一个利用 j子立心革热的项目。 它涉及调查人们和用户必须说明他们是如何肯定的,是谁是谁。

    $(function() {
    $( "#slider-range-min1" ).slider({
        range: "min",
        value: 0,
        min: 0,
        max: 100,
        slide: function( event, ui ) {
            jQuery( "#amount1" ).val(ui.value + "%" );
        }
    });
$( "#amount1" ).val($( "#slider-range-min1" ).slider( "value" ) + "%" );
});

由于一个问题可能有4-5个答案,每个答复都有一个与其有关的分数,对20个问题进行调查时,个人分母的职能将太多。 我能够生动地安置他们,但必须找到更好的办法。 如同控制所有梯子,只用一种功能,简单地通过干.和投入。

我用班子而不是身份证进行审判,但当我这样做时,梯子就消失了,因为 j子Ui似乎在跑时间只把自己的班子留给了伤员。

成就

问题回答

science科学的答案是正确的,但可能不完整。 为此:

<div class="container">
<input type="text" class="inputField"/>
<div id="answer-1" class="answer"></div>
</div>
<div class="container">
<input type="text" class="inputField"/>
<div id="answer-2" class="answer"></div>
</div>
<div class="container">
<input type="text" class="inputField"/>
<div id="answer-3" class="answer"></div>
</div>

$(".answer").slider({
    range: "min",
    value: 0,
    min: 0,
    max: 100,
    slide: function( event, ui ) {
        var container = $(ui.handle).parents(".container");
        $(container).find(".inputField").val(ui.value);
    }
});

Are you trying to simply make all of the answer divs sliders in one call? If so this should work:

<div id="answer-1" class="answer"></div>
<div id="answer-2" class="answer"></div>
<div id="answer-3" class="answer"></div>

$(".answer").slider({
        range: "min",
        value: 0,
        min: 0,
        max: 100,
        slide: function( event, ui ) {
            jQuery( "#amount1" ).val(ui.value + "%" );
        }
});




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签