2015-01-09, 20:04
- Description:
Hello friends , how about ? I am therefore very happy to be able to start from scratch with my new project is going very well , and only one thing I need , and what I come to speak to them ...
place a navbar with a set of dropdown menu and not opened, or rather, the java script does not fulfill its function.
here I leave two photos
as seen in this photo , get the item "display: none" , and I just want that when someone clicks , remplaze that "display: none " to " display: block "
how is it going
this is the code
- Code:
jQuery(document).ready(function($) {
$('.dropDownHook span').on('click', function() {
$(this).parents('.dropDownHook').children('.dropDownContent').stop(true, true).slideToggle('fast', function() {
if ($('.dropDownContent').is(':visible')) {
// This alters the content of the "hook" when we open the drop down
$('.dropDownHook span').html('Welcome <span class="USERNAME"></span> ▲');
}
else {
// This alters the content of the "hook" when we close the dropdown
$('.dropDownHook span').html('Welcome <span class="USERNAME"></span> ▼');
}
});
});
$('html').on('click', function() {
$('.dropDownContent:visible').slideToggle('fast');
});
$('.dropDownHook > *').on('click', function(event) {
event.stopPropagation();
});
});
and this is the code html
- Code:
<div class="dropeDownHook">
<span>Welcome <span class="USERNAME"></span> ▼</span>
<div class="dropeDownContent" style="display: none;">
<div class="arrow_box"></div>
<ul style="border-right: 1px solid rgba(17, 17, 17, 0.35);margin-right: 4%;padding-right: 4%;">
<li><a href="/profile?mode=editprofile&page_profil=avatars" original-title=""><i class="icon-picture hcon"></i>Cambiar Avatar</a></li>
<li><a href="/profile?mode=editprofile&page_profil=signature" original-title=""><i class="icon-pencil hcon"></i>Cambiar firma</a></li>
<li><a href="/profile?mode=editprofile" original-title=""><i class="icon-edit-sign hcon"></i>Editar perfil</a></li>
<li><a href="/u" target="_blank" original-title="" class="profile-u><i class="icon-user hcon"></i>Ver Perfil</a></li>
</ul>
<ul>
<li><a href="/privmsg?folder=inbox" original-title=""><i class="icon-envelope hcon"></i>Bandeja de mensajes</a></li>
<li><a href="/profile?mode=editprofile&page_profil=friendsfoes" original-title=""><i class="icon-group hcon"></i>Lista de Amigos</a></li>
<li><a href="/login?logout" rel="nofollow" id="logout" original-title=""><i class="icon-signout hcon"></i>Desconectar</a></li>
</ul>
</div>
</div>
any help?
- Information:
Forum: | http://demo-4reyes.foroactivo.com/ | Version: | PUNBB |
Type: | Errors in code | Tags: | Problem,DropDown,Navbar |