Skip to main content

CSS3: Have a block display with 2 text lines top-right and buttom-right with a link-text in the middle

CSS: Mix block display with html/css text ansd styles. Extending dropdown menu with update date and site count in block style. Cool menu.

Hi guys,

I found a cool menue display with CSS, JS and Html that look like this:

drop about settings Test 1 Test 2 Test 3 Test 4 help more deeper deep 1 deep 2 deep 3 test no drop
var count = 1
setTimeout(demo, 500)
setTimeout(demo, 700)
setTimeout(demo, 900)
setTimeout(reset, 2000)

setTimeout(demo, 2500)
setTimeout(demo, 2750)
setTimeout(demo, 3050)


var mousein = false
function demo() {
   if(mousein) return
   document.getElementById('demo' + count++)
      .classList.toggle('hover')
   
}

function demo2() {
   if(mousein) return
   document.getElementById('demo2')
      .classList.toggle('hover')
}

function reset() {
   count = 1
   var hovers = document.querySelectorAll('.hover')
   for(var i = 0; i < hovers.length; i++ ) {
      hovers[i].classList.remove('hover')
   }
}

document.addEventListener('mouseover', function() {
   mousein = true
   reset()
})


html, body{ padding:0px; margin:0px; background:#ffffff font-style: Verdana; width:100vw;

} body * { margin:0; padding:0; }

HTML Nav Styles */ nav menuitem { position:relative; display:block; opacity:0; cursor:pointer;

}

nav menuitem > menu { position: absolute; pointer-events:none;

} nav > menu { display:flex; }

nav > menu > menuitem { pointer-events: all; opacity:1; } menu menuitem a { white-space:nowrap; display:block; }

menuitem:hover > menu { pointer-events:initial;

} menuitem:hover > menu > menuitem, menu:hover > menuitem{ opacity:1; } nav > menu > menuitem menuitem menu { transform:translateX(100%); top:0; right:0; } User Styles Below Not Required */

place in browser win */ nav { margin-top: 20px; margin-left: 20px; }

nav a {

background:#f0f8ff; color:blue; min-width:190px; transition: background 0.5s, color 0.5s, transform 0.5s; margin:0px 6px 6px 0px; padding:20px 40px; box-sizing:border-box; border-radius:3px; box-shadow: 0px 2px 4px rgba(100, 100, 100, 0.5); position:relative;

}

nav a:hover:before { content: ''; top:0;left:0; position:absolute; background:rgba(100, 100, 100, 0.2); width:100%; height:100%; }

nav > menu > menuitem > a + menu:after{ content: ''; position:absolute; border:10px solid transparent; border-top: 10px solid blue; left:12px; top: -40px;
} nav menuitem > menu > menuitem > a + menu:after{ content: ''; position:absolute; border:10px solid transparent; border-left: 10px solid blue; top: 20px; left:-180px; transition: opacity 0.6, transform 0s; }

nav > menu > menuitem > menu > menuitem{ transition: transform 0.6s, opacity 0.6s; transform:translateY(150%); opacity:0; } nav > menu > menuitem:hover > menu > menuitem, nav > menu > menuitem.hover > menu > menuitem{ transform:translateY(0%); opacity: 1; }

menuitem > menu > menuitem > menu > menuitem{ transition: transform 0.6s, opacity 0.6s; transform:translateX(195px) translateY(0%); opacity: 0;

menuitem > menu > menuitem:hover > menu > menuitem,
menuitem > menu > menuitem.hover > menu > menuitem{
transform:translateX(0) translateY(0%); opacity: 1;

I try to extend the code, but break my fingers on it for days.

The block display of every bock of every menue, menuitem looks like this:

/some padding space /link with link-text middle with some padding /some padding space

I want to extend the code by two things. First I want that ever block link on hover has now 3 lines look like this:

/on valign top-right in different font-style (size, font, color ..) Last Update: 2023.02.19 - in one line, no link /the link line displayed as Block /on valign bottom-right in different font-styles (size, font, color ..) Current Sites: 15 - in one line, no link

Second I want have an inactive class in CSS like the win app deactive display gray back in gray text color that displays the menuitem in that color (text and backgroubd), but deactivate further droping menues.

Due lack of progress I would like ask you, if you have any ideas. TY very much in advance.

Via Active questions tagged javascript - Stack Overflow https://ift.tt/1rvRLgp

Comments

Popular posts from this blog

ValueError: X has 10 features, but LinearRegression is expecting 1 features as input

So, I am trying to predict the model but its throwing error like it has 10 features but it expacts only 1. So I am confused can anyone help me with it? more importantly its not working for me when my friend runs it. It works perfectly fine dose anyone know the reason about it? cv = KFold(n_splits = 10) all_loss = [] for i in range(9): # 1st for loop over polynomial orders poly_order = i X_train = make_polynomial(x, poly_order) loss_at_order = [] # initiate a set to collect loss for CV for train_index, test_index in cv.split(X_train): print('TRAIN:', train_index, 'TEST:', test_index) X_train_cv, X_test_cv = X_train[train_index], X_test[test_index] t_train_cv, t_test_cv = t[train_index], t[test_index] reg.fit(X_train_cv, t_train_cv) loss_at_order.append(np.mean((t_test_cv - reg.predict(X_test_cv))**2)) # collect loss at fold all_loss.append(np.mean(loss_at_order)) # collect loss at order plt.plot(np.log(al...

Sorting large arrays of big numeric stings

I was solving bigSorting() problem from hackerrank: Consider an array of numeric strings where each string is a positive number with anywhere from to digits. Sort the array's elements in non-decreasing, or ascending order of their integer values and return the sorted array. I know it works as follows: def bigSorting(unsorted): return sorted(unsorted, key=int) But I didnt guess this approach earlier. Initially I tried below: def bigSorting(unsorted): int_unsorted = [int(i) for i in unsorted] int_sorted = sorted(int_unsorted) return [str(i) for i in int_sorted] However, for some of the test cases, it was showing time limit exceeded. Why is it so? PS: I dont know exactly what those test cases were as hacker rank does not reveal all test cases. source https://stackoverflow.com/questions/73007397/sorting-large-arrays-of-big-numeric-stings

How to load Javascript with imported modules?

I am trying to import modules from tensorflowjs, and below is my code. test.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title </head> <body> <script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js"></script> <script type="module" src="./test.js"></script> </body> </html> test.js import * as tf from "./node_modules/@tensorflow/tfjs"; import {loadGraphModel} from "./node_modules/@tensorflow/tfjs-converter"; const MODEL_URL = './model.json'; const model = await loadGraphModel(MODEL_URL); const cat = document.getElementById('cat'); model.execute(tf.browser.fromPixels(cat)); Besides, I run the server using python -m http.server in my command prompt(Windows 10), and this is the error prompt in the console log of my browser: Failed to loa...