开发者

Trigger jQuery function when <form> content changes.

开发者 https://www.devze.com 2023-03-24 01:51 出处:网络
I have a form that dynamically changes when a button and/or link is clicked, and I am using jScrollPane in a div located inside the form called \".softcontent\".

I have a form that dynamically changes when a button and/or link is clicked, and I am using jScrollPane in a div located inside the form called ".softcontent".

When the content开发者_如何学编程 in the form changes the jScroll function does fire again.

So my question is: How do I trigger my jScrollPane function when the content in the form changes so the new content that fills the form have the same scrollpane?

The jScrollpane function:

$(function scrollbar() {
        $('.softcontent').jScrollPane();
});

Please let me know if I need to provide more or further detailed information, Thank you.


I do not fully understand "so the new content that fills the form have the same scrollpane?", but I believe it is irrelavant.

You bind an event to all form inputs: $('#my-form input').change(function(){ ... });

Just do whatever you need inside the handler. Details: http://api.jquery.com/change/

0

精彩评论

暂无评论...
验证码 换一张
取 消