제이쿼리 질문드립니다 ^^; 채택완료
갱쿤
7년 전
조회 1,770
</p>
<p> </p>
<p><link href="<a href="http://www.jqueryscript.net/css/jquerysctipttop.css"" target="_blank" rel="noopener noreferrer">http://www.jqueryscript.net/css/jquerysctipttop.css"</a> rel="stylesheet" type="text/css">
<link rel="stylesheet" href="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/themes/smoothness/jquery-ui.css">" target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/themes/smoothness/jquery-ui.css"></a>
<script src="<a href="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> " target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> </a>
<script src="<a href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script> " target="_blank" rel="noopener noreferrer">http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.0/jquery-ui.min.js"></script> </a></p>
<p> </p>
<p><div id="range"> <img src="/theme/basic/img/1.jpg" id="currentVal"/></div></p>
<p><script></p>
<p>(function() {
$("#range").slider({
range: "min",
max: 12,
value: 1,
slide: function(e, ui) {
/*
$("#currentVal").html(ui.value)
*/
$("#currentVal").attr("src",ui.value);
}
});</p>
<p>}).call(this);
</script></p>
<p>
스크롤을 움직이면
#currentVal 이미지 경로가 /theme/basic/img/(제이쿼리 value 1~10).jpg
으로 변경하고 싶은데 혹시 이렇게 변경이 가능할까요? ^^;
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
7년 전
검색 + 삽질하다가 적용했습니다 ㅎㅎ;
</p>
<p><script></p>
<p>(function() {</p>
<p> var urltext = "/theme/basic/img/";</p>
<p> $("#range").slider({
range: "min",
max: 12,
value: 1,
slide: function(e, ui) {
/*
$("#currentVal").html(ui.value)
*/
$("#currentVal").attr("src",
function(){
return "/theme/basic/img/" + ui.value + ".jpg";
});</p>
<p> }
});</p>
<p>}).call(this);
</script></p>
<p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인