How to find hidden elements using jquery selector [closed] - javascript

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
Trying to find how many items with a class are visible but I'm getting weird results from my jquery selector
There's 5 elements total with only one where I removed the style

Elements with visibility: hidden or opacity: 0 are considered to be
visible, since they still consume space in the layout. - jQuery API Docs.
So, instead you should give these elements a display: none; rule or set their height to 0 in order to make them catchable by the :hidden jQuery selector.

Related

:before only working on last element [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I have a project which renders multiple spinners and I've noticed that on reload only the last spinner is spinning. All the elements use :before.
I am aware that this is fixable by removing the :before in the css but I would like to know why this was the case.
Here's the example, you'll see all the spinners load then when you click on the "reload" text only the last spinner will spin.
Link to JSFiddle
The issue is you're setting before on .spinner class.
Set it on .spinner-container class and it will work as expected
Check this fiddle
Reach doesn't work in stack snippet. That's why I added a js fiddle

How to tell if flex-item is being wrapped [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I need to apply different styles if a flex-item is being wrapped. I can't find any css or js indicator that a flex-item is being wrapped.
The browser has to know that the item is being wrapped...
Where can I bubble that up to effect the styles being applied?
I need to have a "spacer" margin when wrapped, but the margin should be removed when the flex item is not wrapped.
The solution that seems best to me, is to add an attributed "wrapped" to each flex child once they are wrapped, and remove it when they are not wrapped. This can be done by comparing the width of the flex-container to the sum of the widths of the flex-children. I'll post a code snippet once I finish writing it.
There ought to be an attribute added to wrapped flex items by the browser.

Bring <div> "infront" of parent <div>, but make JS skip it [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I want to make the div slidestatic really static. I don't want it to shrink with the other divs. When I make the z-index of the parent -1, I don't have access to the <a href>s anymore, I can't click them. Thanks
Demo
Apply The position property to the slidestatic div. Change slidestatic div to direct child of slider div and add style "position:fixed to slidestatic div.
#slidestatic {
position:fixed;
top:10px;
}
Here is the FIDDLE
Hope this will fix your problem.
An alternative way is to add animation to the description div.
Here is the FIDDLE

jQuery UI Draggable - drag beyond absolute positioning [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I am unable to see the elements that i am dragging once they leave a parent element that has absolute positioning. (Cant see the draggable helper as it moves)
Check out the example at http://nairobi.io/tests/jquery-ui-draggable
Kindly help me fix this problem.
You've misspelled "appendTo" as "apendTo" in your draggable initialiser (line 138), which means the helper is not being added to the right place.

Smooth Scroll is not working properly [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I have copied javascript code of smooth scroll from stackoverflow and modified in my page but it is not working.
The Original Code is given here:
http://jsfiddle.net/swfour/dN4S4/1/
The Modified Code :
http://codepen.io/anon/pen/VYmLva
There are several issues:
JQuery was not linked in your codepen
Your ids in your a tags looked like this:
id="#sld1" //should be just sld1 no #
instead of this
id="sld1" // # isn't included in HTML, thats a CSS indicator
you were calling:
onmousedown="autoScroll('slide1');
In your a tags but autoSCroll was not defined in your JS
This line in your if statment:
$(this).get(0).id
Should just be $(this).attr("id")
overflow: hidden on your body, html was preventing the page from animate scrolling down. Remove that.
In fact you don't need those if statements at all. Since you're calling the id of the div in your href you can simply do:
target = $(this).attr("href");
Which would return: #slide1 or #slide2, etc. That will target your div of the same id
NEW CODEPEN

Categories

Resources