Posts by Caio Tarifa • 2,251 points
14 posts
-
5
votes3
answers3185
viewsA: How to create random audio playlist?
You came close, missed making the interactions between Javascript and HTML, as well as calling the functions of the element audio. See in the code below how simple it is: HTML <audio…
-
5
votes2
answers498
viewsQ: View navbar only when user scrolls up on iOS
I’m using the technique of Marius Craciunoiu to display my entire navbar when the user scrolls the screen up. So, here’s my code Javascript (using jQuery): var delta, didScroll, lastScrollTop,…
-
6
votes1
answer7577
viewsA: How to customize the arrow of a select
Unfortunately it is still not possible to do this in the "right way" on all browsers, since the property appearance is not ubiquitous. Support from current browsers: For now, it’s important to…
-
3
votes1
answer241
viewsQ: Conflicts between double tap and click. (jQuery and Hammer.js)
I’m trying something different, I would like to implement something similar to an Instagram feature: two tapas to give like. To try this, I am using the latest versions of jQuery and Hammer.js. I am…
jqueryasked Caio Tarifa 2,251 -
6
votes3
answers694
viewsQ: Scale div as image
I’m making a list of items, but this has some challenges: Responsive; Title may have more than one line; Sometimes I need to show an icon with a background color instead of the full image. Here is a…
-
5
votes1
answer1015
viewsQ: Scrolling Effect with Parallax Using Video
I’m studying effects with Parallax and I’m trying to display a video in the background instead of an image. So I was able to create a good effect using image as background. Here is my code jQuery:…
-
4
votes4
answers1488
viewsQ: How to close a dropdown if the user clicks another page location?
What is the best method to hide a div, that is fulfilling the role of dropdown, when the user clicks on another page location? At first, I value solutions cross-browser and without the use of…
-
4
votes8
answers14487
viewsA: How to create a copy of an object in Javascript?
I believe you can do so, if you are using jQuery: var cachorro2 = $.extend(true, {}, cachorro); or else with Underscore: var cachorro2 = _.clone(cachorro); Amendments subsequent to cachorro2 no…
-
33
votes3
answers154319
viewsQ: How to center horizontally one div within another?
How can I center a horizontal div that is inside another div using only CSS? In this case, we can assume that div external outer has a width of 100%. <div id="outer"> <div…
-
42
votes3
answers154319
viewsA: How to center horizontally one div within another?
There are several ways. These methods are divided into "defined width" and "variable width" because it depends on your need for implementation. Some are semantically more recommended, but still do…
-
45
votes5
answers87966
viewsA: How to print content inside a HTML div?
Unable to select a div for printing with Javascript, because this is not a function of it. There is a solution that uses only CSS: @media print { body * { visibility: hidden; } #printable,…
-
7
votes2
answers2862
viewsA: How do I turn my computer off, restart, sleep programmatically?
You can use the library System.Diagnostics. Using System.Diagnostics; Within some action you can enter the command Process.Start: { Process.Start("Shutdown", "-i"); }…
-
21
votes3
answers90884
viewsQ: Attribute "href" for Javascript links: "#" or "javascript:void(0)"?
Popularly, there are two methods of creating links that perform a function in Javascript, are they: <a href="#" onclick="myFunction();">Executar JavaScript</a> or <a…
-
25
votes3
answers90884
viewsA: Attribute "href" for Javascript links: "#" or "javascript:void(0)"?
None. Problems Using any of these examples promotes "obstructive Javascript" which makes the code difficult to maintain and not scalable at all. Use javascript:void(0) does not allow users to open…