Posts by John Quimera • 541 points
35 posts
-
0
votes0
answers83
viewsQ: Restore removed element with jquery
The element div.mega-posts is inside a menu, nav, this element, when depending on the resolution, goes into the element ul#overflow where it is not necessary, and then we remove with .remove(). So…
jqueryasked John Quimera 541 -
1
votes2
answers200
viewsA: Delay closing a dropdown
This is an almost perfect basic jquery solution, using the setTimeout References: https://stackoverflow.com/a/18514406/2705271 http://jsfiddle.net/cse_tushar/5G3BH/16/ jQuery(function($) { "use…
javascriptanswered John Quimera 541 -
6
votes2
answers200
viewsQ: Delay closing a dropdown
Is there a way, alternative, more lite, to superfish, to delay the closing of a dropdown menu? When the menu is at Hover, it obviously opens, and when the mouse is no longer focused on it, the menu…
javascriptasked John Quimera 541 -
0
votes0
answers19
viewsQ: Overlay value of styles passed dynamically
I’m using the jquery superfish to make some optimizations in a menu. This plugin passes the value display:none or block for the element sub-menu That way: <ul class="sub-menu"…
javascriptasked John Quimera 541 -
1
votes1
answer20
viewsQ: Prevent Undefined of elements that may or may not appear in the document
The JS DOM below is to modify through the classes, the styles of two elements that are created dynamically in the document. But it’s not often that these elements will appear in the document. Maybe…
javascriptasked John Quimera 541 -
1
votes2
answers131
viewsQ: Find class of a dynamically created element
Called the Nav Priority, a lib that places the execendent items within a new drop-down, called "More" this dropdown is dynamically created in pure javascript as soon as it is needed. In it appears a…
javascriptasked John Quimera 541 -
0
votes0
answers63
viewsQ: Reusing a jquery code for Wordpress post uploads
I have a code, which loads wordpress posts via ajax. Works very well in all templates. Index, tag, categories, etc. What strikes me in this code is that apparently the upload is done through the…
-
1
votes1
answer49
viewsQ: Focus/active event in a header
I have a traditional header, which thanks to @hugocsl, who helped me in that question, a color transition occurs when a menu item is in hover. Everything works very well, what I want now is to…
cssasked John Quimera 541 -
0
votes1
answer72
viewsQ: Detect width of Scrollbar
To leave well structured a page that will have the scrollbar disabled when a certain button is clicked, I think about setting an additional padding to the body com js, to compensate for the hidden…
javascriptasked John Quimera 541 -
0
votes3
answers65
viewsQ: Optimize the way to remove classes of elements
I have a sequence of lines to remove classes of various elements. There would be a more sophisticated way, perhaps with less code to perform the same as the code below?…
-
1
votes2
answers837
viewsQ: Always keep a dropdown menu open
Using plugin Jquery Dropdown: https://github.com/soundasleep/jquery-dropdown To create multiple menu styles, it is simple and easy to customize. I wanted to see if it would be possible to keep it…
-
2
votes1
answer50
viewsQ: Stoppropagation with right click / right click
With this code I can stop the spread of a dropdown menu by clicking on the document. It works very well. Now I would like to accomplish the same thing, but with the right click. The magic happens…
-
2
votes4
answers283
viewsQ: Toggle header colors based on menu Hover
I have a traditional header, with logo and links menu, I would like to change the header colors based on the Hover of each link in the menu. h1 { padding: 0; margin: 0; color: #fff } header {…
-
1
votes1
answer313
viewsQ: Close dropdown with ESC key
It would be possible to make the dropdown below, close with the ESC key? $("#jq-dropdown-1").on("contextmenu", function(event){ event.stopPropagation(); var a =…
jqueryasked John Quimera 541 -
0
votes3
answers277
viewsQ: Overwrite native HTML scroll
The javascript Alert event has an interesting effect, when it goes into activity, a modal appears, not hiding or disabling, but superimposing the native HTML scroll. How can we perform this same…
javascriptasked John Quimera 541 -
1
votes2
answers894
viewsQ: Height Proportional to Width, responsive
Below we have a grid layout, fluid, no images. What I would like now is for height to be proportionally responsive to width. https://codepen.io/johnquimera/pen/aGZaVY .my-prop-grid { width: 46%;…
cssasked John Quimera 541 -
1
votes1
answer62
viewsQ: Fixed Menu with Pure Javascript
I have a menu in jQuery that is fixed when scrolling up. Works well. Now I would like to have the same effect, only with pure javascript. Example of jquery menu :…
-
1
votes2
answers45
viewsQ: Identify if a link points to an image, and add a class
On one page, there are links that point to images. <a class="native-class" href="http://localhost/test/wp-content/uploads/2017/10/7-3.jpg"></a> I am aware that I could add another class…
javascriptasked John Quimera 541 -
1
votes3
answers386
viewsQ: Background image, without using background-image
In the code below you will see the solution of @hugocsl to another question my. What I am wanting to do now is to put in this element, a background image without using background-image but with…
-
1
votes1
answer53
viewsQ: Center text on element, proportionally
In the example below we use, transform: translate(-50%,-50%); to keep a text in the middle of the element. But it’s not a solution that works in all browsers. I would really like to do it, but with…
cssasked John Quimera 541 -
1
votes1
answer67
viewsQ: Capture link and title, and move to a single modal
A list of 5 articles, with different links and titles, each with a link Share that opens a modal, where it has four buttons to be shared on social media. To be shared it is necessary to have the…
-
3
votes2
answers129
viewsQ: Minimal Hover Menu - The Right Way
In the example below we have an interesting menu, with a effect Hover, which follows the mouse and its items. Everything is very beautiful and works well. The problem is that this menu is set with…
-
1
votes1
answer66
viewsQ: Capture author name of a comment to be answered
On the Facebook/Disqus feedback system, when we click to reply to a comment, it automatically puts it on textarea the username of the comment we are responding to. I wonder if it would be possible…
-
1
votes1
answer153
viewsQ: Calculate Auto Aspect Ratio Automatically
With the example below we calculate the Aspect ratio of an image by setting Width/Height manually, with this the value of the Aspect ratio is generated to be put in the padding-bottom: What I would…
-
0
votes2
answers219
viewsQ: Encrypt variables in the URL
With @dvd solution, we pass variables to the URL through a select: /a/277883/95735 There are several that look like this when they are passed: example.com/? background=img&cor=red What I’d like…
javascriptasked John Quimera 541 -
1
votes2
answers661
viewsQ: Remove Class from a div Parent based on child element class
I’m using Lazysizes to load images progressively. https://github.com/aFarkas/lazysizes That’s the style of my project <div class="image-wrap"> <img class="lazyload" src=""> </div>…
-
1
votes1
answer135
viewsQ: Pass variables to the url through a Select Box
With this php code, we pass variables to url manually. if (isset($_GET['layout'])) { $layout = $_GET['layout']; } else { $layout = '1'; } With this other, in javascript, authored by @dvd apply the…
-
2
votes1
answer213
viewsQ: Variable by URL on all page links
I am using the following code to pass variables through the URL, in wordpress. if (isset($_GET['layout'])) { $layout = $_GET['layout']; } else { $layout = '1'; } With $layout I recover the value in…
-
1
votes1
answer181
viewsQ: Jquery Dropdown, stop propagation with right click
I am using Jquery Dropdown: https://labs.abeautifulsite.net/jquery-dropdown/ In the project’s Issue, there is a code that prevents the menu from closing by clicking as a left button, I would like it…
jqueryasked John Quimera 541 -
1
votes2
answers97
viewsQ: Multiple dropdowns on the same page
I’m having a problem with the example below. Several jquery dropdowns on the same page, they all open perfectly, but they all open, even when clicked on another dropdown, I wanted only one dropdown…
jqueryasked John Quimera 541 -
0
votes1
answer79
viewsQ: Prevent Dropdown Menu from closing with Right Click inside it
I would like this Dropdown menu not to close when right-clicking inside it to open a link in a new tab. /* When the user clicks on the button, toggle between hiding and showing the dropdown content…
-
0
votes1
answer43
viewsQ: Using array to place multiple classes in a DIV
I want to put several classes in one div, using Array, how could I do it? I tried using the code below, but it didn’t work. <?php $minhas_classes = array( 'main-content' => 'main-content',…
phpasked John Quimera 541 -
1
votes1
answer126
viewsQ: Remove class and change value Aria-Hidden by clicking on the body
There is a project in the code pen called "Flex Priority Menu #1.2" is a magnificent menu that when it has many links or the window "resized", it goes hiding and putting in a dropdown [More...].…
-
1
votes1
answer902
viewsQ: Convert a code to jquery for pure Javascript
I have a jquery code that would like to convert it to pure javascript, DOM. Can anyone help me? var mobileItems = jQuery( '#slide-out .nav-mobile .main-menu' ); mobileItems.find(…
-
2
votes1
answer54
viewsQ: Add a class in a div based on the time class of another
I’m using lazyload for a project, it carries images progressively. https://github.com/verlok/lazyload When images are loading, the "loading" class is active in the tag <img…