任何人都可以告訴我如何將當前由單選按鈕控制的以下語句更改爲文檔加載函數。更改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