Display the 'right' style of a div with JQuery

I'm trying to display the "right" value of a div named "slider", displaying it inside of "span.display_value" var rightStyleValue = $('div.slider').css('right'); alert(rightStyleValue); $('.display_value').html(rightStyleValue); --------------------------------------------------------- UPDATE: Html is posted below. I'm using a drag and drop script to drag a div called "slider" that is inside of a div named "container". I want to have it "do something" when the "right" property of the div "slider" reaches 45px(ideally, when the user drags "slider" all the way to the right side of it's parent "container") Right now, when the page loads it will display the value that i specifically set in the css: "Right:-10". so it will display it once, but i'm not sure how to keep updating the displayed value for the "slider" div. i don't know where to put: $('.display_value').html(rightStyleValue); to have it continually updated. ---------------------------------------------------------

slider right:

以上就是Display the 'right' style of a div with JQuery的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准