0
phpFox發佈了3.5.0版本的名爲「Nebula」的主題。在這個主題上,標題上有按鈕,當用戶單擊按鈕時,菜單向下滑動。 (其實不是一個按鈕,而是一個div)將phpFox的一項功能導入SocialEngine
我想將此功能添加到SocialEngine。但是,JavaScript代碼包含一個phpFox變量,我不知道它指的是什麼。我不擅長JavaScript。
HTML:
<div id="nb_features">
<a href="#" id="nb_features_link">Features</a>
<div id="nb_features_holder">
Menu widget code will be added here...
</div>
</div>
的JavaScript:
$Behavior.customNebula = function(){
$('#nb_features_link').click(function(){
if ($(this).hasClass('nb_is_clicked')) {
$(this).removeClass('nb_is_clicked');
$('#nb_features_holder').slideUp('fast');
} else {
$(this).addClass('nb_is_clicked');
$('#nb_features_holder').slideDown('fast');
}
return false;
});
};
CSS:
#nb_features {
position:absolute;
top:0px;
right:0px;
}
#nb_features_link,
#nb_features_link:hover {
display:block;
width:40px;
height:40px;
line-height:40px;
text-indent:-1000px;
overflow:hidden;
background:url(~/application/modules/Wonder/externals/images/nb_features_link.png') no-repeat;
margin-top:-7px;
margin-right:20px;
}
#nb_features_link:hover {
background:#334d83 url(~/application/modules/Wonder/externals/images/nb_features_link.png') no-repeat;
}
#nb_features a.nb_is_clicked,
#nb_features a.nb_is_clicked:hover {
background:#334d83 url(~/application/modules/Wonder/externals/images/nb_features_link.png') no-repeat;
}
#nb_features_holder {
position:absolute;
background:#4f4f4f;
right:0px;
width:980px;
border:1px #304779 solid;
border-top:0px;
display:none;
margin-top:20px;
}
#nb_features_holder ul li a,
#nb_features_holder ul li a:hover {
float:left;
color:#fff;
height:30px;
line-height:30px;
padding:0px 10px 0px 10px;
text-decoration:none;
}
#nb_features_holder ul li a.menu_is_selected,
#nb_features_holder ul li a.menu_is_selected:hover {
background:#009AEF;
color:#fff;
}
#nb_features_holder ul li a:hover {
background:#2F2F2F;
-webkit-transition: all 0.50s ease;
-moz-transition: all 0.50s ease;
-o-transition: all 0.50s ease;
}
我應該怎麼做,使與SocialEngine此代碼的工作?
這是代碼這對phpFox有效。我只需要知道應該做些什麼改變才能使這個代碼在SocialEngine上運行。當我將此作爲一個小部件,我得到的Chrome調試這個錯誤:未捕獲的ReferenceError:未定義$行爲 –
是的,這就是我說的,嘗試用正常的document.ready處理器更換$行爲,我不知道如果社交引擎使用JQuery,但如果它這樣做應該有助於http://api.jquery.com/ready/ – Purefan