如何将按钮设置为默认选择的类(jquery selectable)
嘿那里,这里总javascript noob。 只是想知道,我已经使用jquery selectable在ul标签内部设置了一些按钮,当我点击它们时会改变颜色。 但是有一个问题,如何让其中一个选择加载页面?
谢谢!
编辑:这是我的代码:
$(document).ready(function(){ setLink('single'); $('#target').load($('#single a:first').attr('href')); }); function setLink(id){ $('#'+id+' a').click(function(e){ $('#target').load( this.href, function(){ setLink('target'); } ); return false; }); } #selectable .ui-selecting { background-image:url(../images/nav-li-bcg.png); } #selectable .ui-selected { background-image:url(../images/nav-li-bcg.png); } $(document).ready(function() { $("#selectable").selectable(); $document.getElementById('current1').click(); });
模拟文档上的点击准备好了吗?
$(document).ready(function() { $(".selectable .buttonSelector:first").click(); });
$('#myListItem').addClass('ui-selected');