Javascript 更改图像上的选项卡单击
现在,我尝试在用户单击图像(选项卡上方)时设置此主题的活动选项卡 我在scripts.php中找到了正常的选项卡更改代码,但我不知道如何更改它,使其能够通过单击选项卡上方的任何图像来工作Javascript 更改图像上的选项卡单击,javascript,jquery,html,web,Javascript,Jquery,Html,Web,现在,我尝试在用户单击图像(选项卡上方)时设置此主题的活动选项卡 我在scripts.php中找到了正常的选项卡更改代码,但我不知道如何更改它,使其能够通过单击选项卡上方的任何图像来工作 $service_li.find('a').click(function(){ var $a = jQuery(this), next_tab = $a.parent('li').prevAll().length
$service_li.find('a').click(function(){
var $a = jQuery(this),
next_tab = $a.parent('li').prevAll().length,
next_tab_height = $service_tabs.find('>div').eq(next_tab).outerHeight();
if ( next_tab != active_tab ) {
$service_tabs.css({height:next_tab_height});
$service_div.filter(':visible')
.animate( {opacity: 'hide'},500, function(){
jQuery(this).parent().find('>div').eq(next_tab).animate( {opacity: 'show'},500 );
} )
;
$service_li.removeClass(active_tabstate).filter(':eq('+next_tab+')').addClass(active_tabstate);
active_tab = next_tab;
}
return false;
}).hover(function(){
if ( !jQuery(this).parent('li').hasClass(active_tabstate) && !is_ie ) jQuery(this).fadeTo('slow',.7);
}, function(){
if (!is_ie) jQuery(this).fadeTo('slow',1);
});
}
也许有人能帮上忙?我还不太明白是什么,或者更好的是,为什么你会在那里变出那样的东西,但我会使用,这样你就可以通过在URL中输入
id
或者使用类似..的东西来轻松访问tab对象.tabs(“选择”,索引)
,您可以在上面的URL中找到更多文档。sry,但这不是我想要的。实现jquery标签会打乱我的整个主题,并需要额外的样式设置等。标签和它们一样好。我只需要链接到它们。