Jump to content

Ce nu merge bine (display block si none)?

Recommended Posts

Salut PCT, am acest cod...

$(function() {
var myElement = document.querySelector(".efUserMenu");

if( $('.efUserMenu').hasClass('displayNone')) { 
    myElement.style.display = "block";
if( $('.efUserMenu').hasClass('displayBlock')) { 
    myElement.style.display = "none";


Practic eu vreau un cod care daca div-ul are class-ul "displayBlock" sa execute niste comenzi in momentul in care dau click pe div-ul .operUserMenu si in cazul in care are "displayNone"... Ati prins voi ideea. Prima daca div-ul meu ".efUserMenu" are declarata class-ul ".displayBlock", ok, cand dau click pe ".openUserMenu" dispare, dar din dau din nou pe ".openUserMenu" nu apare la loc. 


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.