Foren

Home » Liferay Portal » English » 3. Development

Kombinierte Ansicht Flache Ansicht Baumansicht
Threads [ Zurück | Nächste ]
toggle
deepthi narendula
related to slider
20. November 2012 02:57
Antwort

deepthi narendula

Rang: Junior Member

Nachrichten: 39

Eintrittsdatum: 26. April 2012

Neue Beiträge

Hi Friends
This is my code for slider,With the help of slider, I can change the value of the text input, but how do you change the position of the slider..please help me out.....

<script type="text/javascript">
$(document).ready(function(){
$("#slider").slider(
{
min:0,
max:250,
step:5,
slide:function(event,ui)
{
$("#txtVal").val(ui.value);
}
});

$("#txtVal").change(function(event) {
var data = $("#txtVal").val();
if (data.length > 0)
{
if (parseInt(data) >= 0 && parseInt(data) <= 250)
{
$("#slider").slider("option", "value", data);
}
else
{
if (parseInt(data) < 0)
{
$("#txtVal").val("0");
$("#slider").slider("option", "value", "0");
}
if (parseInt(data) > 250)
{
$("#txtVal").val("250");
$("#slider").slider("option", "value", "250");
}
}
}
else
{
$("#slider").slider("option", "value", "0");
}
});
});
</script>

</head>
<body>
<table cellspacing="5" cellpadding="5">
<tr>
<td>Select Value:</td>
<td><div id="slider" style='width:300px'></div></td>
<td><input type="text" id="txtVal" size="3"></td>
</tr>
<table>
</body>
</html>
Thanks & Regards
N.Deepthi.
Hitoshi Ozawa
RE: related to slider
20. November 2012 14:07
Antwort

Hitoshi Ozawa

Rang: Liferay Legend

Nachrichten: 7952

Eintrittsdatum: 23. März 2010

Neue Beiträge

Are you trying to create your own slider using JavaScript? Should post your question to some JavaScript forum instead of liferay forum because I can't figure out how your question is concerned with liferay.
deepthi narendula
RE: related to slider
21. November 2012 00:00
Antwort

deepthi narendula

Rang: Junior Member

Nachrichten: 39

Eintrittsdatum: 26. April 2012

Neue Beiträge

ok fine i got the solution