任何人都可以告诉我如何将当前由单选按钮控制的以下语句更改为文档加载函数。更改jQuery函数为页面加载
基本上我希望幻灯片div在页面加载时从左向右滑出。 jQuery的:
jQuery(function() {
jQuery('#slide').hide();
jQuery(':radio[name=radiobutton]').click(function() {
var value = $(this).val();
if (value === 'Y') {
jQuery('#slide').show('slow');
} else if (value === 'N') {
jQuery('#slide').hide('slow');
}
});
HTML:
<div id="slide" class="alpha60">
<p class="statement_style_head">Content goes here</p>
<p class="statement_style_text">A line or two of text goes here </p>
</div>
最佳做法,你可以试试这个链接对于滑动示例:http://www.learningjquery.com/2009/02/slide-elements-in-different-directions – 2010-12-03 20:58:00