Posts by Renan Gomes • 19,011 points
435 posts
-
2
votes1
answer35
viewsA: How can I use a Less variable to give the source address?
Use @{nome_da_variavel}: For example: @address: "/ui/lib/fonts/opensans/v8"; @font-face { font-family: "Open Sans"; font-style: normal; font-weight: 400; src: local("Segoe UI"), local("Open Sans"),…
-
3
votes1
answer1959
viewsA: I need a sequential generator in javascript
It is unclear whether you should consider the index or the number of elements. For example, 5 repetitions based on the quantity: [0][1][2][3][4] = 5 elementos. Or, 5 repetitions considering the…
-
4
votes1
answer1440
viewsA: How to center a Jframe on the computer screen?
Use Window#setLocationRelativeTo() passing the value null as argument. According to the documentation: If the Component is null, or the GraphicsConfiguration Associated with this Component is null,…
-
6
votes2
answers5296
viewsA: Counter Javascript de clicks
You can take the number with Node.textContent and add +1 to each click. Always replacing the textContent. var contador = document.querySelector('.badge');…
-
4
votes2
answers439
viewsA: How to checkbox in the corner of an image?
Before answering what was asked, one remark: it is not possible to style a input of the kind checkbox just defining the property background (or background-color). But there are some ways around it…
-
2
votes4
answers13696
viewsA: Display message and hide in a few seconds
It is not necessary Javascript for this, you can only use the animations of the CSS since you want to display the notification as soon as the user enters the site, not when the page is fully loaded…
-
1
votes2
answers135
viewsA: Help with HTML/Javascript
I would start by changing HTML, use <div> and classes to group elements. When to use the attribute class in the HTML elements? The way you are doing, you will have a huge job only to get the…
-
6
votes1
answer1128
viewsQ: Why put . jsp file in WEB-INF directory?
Taking Maven as an example, when starting a new web project, the structure is equal/similar to this: Meu Projeto |- src |- main |- java |- resources |- webapp |- WEB-INF Where, in the directory…
-
1
votes2
answers996
viewsA: Is it wrong to use ! Import to override Bootstrap rules?
Not wrong but unnecessary since Bootstrap has a page that allows to customize the CSS and the components you will use. In the old days you had to download the source code, modify the files. Less and…
-
2
votes1
answer137
viewsA: Create a single change function for multiple CSS selectors in Jquery
There are several ways to do. One option is to use a parameter in the function select_changed to define the target element: function select_changed(target){ jQuery('select#selcolor').each(function()…
-
1
votes1
answer1058
viewsA: How to add color in the select option’s Hover?
I don’t know a way that isn’t hack, even because this element is rendered by the operating system. You can implement your own select (with <ul> and <li) or use one of several plugins that…
cssanswered Renan Gomes 19,011 -
2
votes2
answers2693
viewsA: Click on an image to show a div
Can do only with CSS, using the selector target: div { display: none } /* Por padrão, os divs iniciam ocultos. */ div:target { display: block } /* Exibe quando o elemento é alvo. */ <a…
-
1
votes2
answers464
viewsA: How to get HTML code from a protected page with Cloudflare?
I ended up leaving Jsoup and using a webdriver. I chose the Htmlunit for this and the code that solves the problem I was encountering is this: import java.io.IOException; import…
-
-3
votes2
answers464
viewsQ: How to get HTML code from a protected page with Cloudflare?
I’m trying to get the HTML of a page with the Jsoup. This page has Cloudflare as protection and, instead of getting the HTML code of the site I’m interested in, it’s returning me the HTML of the…
-
2
votes2
answers1031
viewsA: Event click button
Use the method setActionCommand() to set an action for the button. Then you can take this value when the event is triggered: for(int i = 0; i <= 10; i++){ bt = new JButton("BT : " + i);…
-
7
votes3
answers212
viewsA: What Does This CSS Code Do ?
This rule will create a special element (called pseudo element) before and after those who possess the class .nav. In this particular case, it appears to be a type of clearfix, placing two spaces…
-
2
votes2
answers853
viewsA: How to get input value by clicking the div(multiple Divs with the same class) with jquery?
How do you want to catch a child element in .premios, use the function children(): $(function(){ $('.premios').on('click',function(){ var id = $(this).children('.idPremio').val(); alert(id); }); });…
-
12
votes1
answer3813
viewsQ: What is the "application/Ld+json" type for in a <script> tag?
I was looking at the source code of the Kickass page and this excerpt caught my eye: <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "url":…
-
3
votes2
answers1160
viewsA: How to copy an html block when clicking a link/button?
Look at that: Insert several <input> unadjusted name, they won’t even be submitted. Insert several <input> with the same value in the attribute name, only the last will be submitted.…
-
3
votes3
answers2061
viewsA: Exit button with message
Use confirm() to get confirmation from the user, if he really wants to quit. As the element is a hyperlink which already points to the resource that performs the logout, you need only prevent…
-
3
votes2
answers4909
viewsA: Limit texts by placing reticence at the end, use of Angularjs
You can limit the view with CSS by using the property text-overflow: ellipsis. p { max-width: 190px; /* Tamanho */ overflow: hidden; text-overflow: ellipsis; white-space: nowrap } <p>Mussum…
-
2
votes2
answers596
viewsA: How to redirect the page only after confirmation?
In your case, as the element is already a hyperlink, just capture the return of the confirm and prevent the default behavior of the browser (access link) if the return value is false. Technically…
-
3
votes5
answers5903
viewsA: Capture filename in directory
Can use DirectoryStream<T> where the generic type is an interface Path: // C:\Users\Fulano\Desktop Path diretorio = Paths.get("C:", "Users", "Fulano", "Desktop"); try…
-
6
votes4
answers8751
viewsA: Change color marker li
You can use the property list-style-image and set an image to replace the polka dots: ul { list-style-image: url('http://i.stack.imgur.com/5kI3v.png') } <ul> <li>foo</li>…
-
3
votes2
answers1250
viewsA: How to send a form automatically when inputs are completed?
You can wait for the event blur in the inputs and if both are with a defined value, the form will be submitted. (function() { var $gols1 = document.getElementById('gols1'), $gols2 =…
javascriptanswered Renan Gomes 19,011 -
2
votes3
answers6430
viewsA: How to change the color of a Glyphicon?
Just change the color of the pseudo-element :before, this will affect only the icon: .glyphicon:before { color: red } <link…
-
10
votes1
answer112
viewsQ: What is the purpose of "&" in the generic type statement?
In that code, the author creates a class as follows: public abstract class GlyphIcon<T extends Enum<T> & GlyphIcons> extends Text { /* ... */ } My question is to understand the…
-
3
votes3
answers113
viewsA: Is it possible to create predefined css values?
So far it is not possible to define values in the same way that we are used to declaring variables, at least not in a way cross-browser. One way to simulate this is to create classes that contain…
cssanswered Renan Gomes 19,011 -
1
votes1
answer412
viewsA: How to insert declared CSS with Javascript after scrolling the page
Before answering the question, a note about what was said in the comments: Javascript variable statements do not need the $ in the front. As far as I know, this is a way that developers have adopted…
-
0
votes2
answers22610
viewsA: How to take the value of one input and assign it to another?
Just set the property value of the element: var a = document.getElementById('a'); var b = document.getElementById('b'); b.value = a.value; <input id='a' type='text' value='StackOverflow'/>…
-
1
votes1
answer79
viewsA: Identify CSS not loaded in with Firebug?
It is not necessary to use Firebug, you can monitor the network by the browser itself: Press Ctrl + shift + k; Go to the "Network" tab and reload the page you’d like to monitor. The result will be…
-
1
votes1
answer1493
viewsA: How to return a selected value in a select?
It was not very clear if what you want to display is the value or text of the option. Anyway I created a snippet with both values. If you want to get the value of the selected option, use…
-
3
votes2
answers3496
viewsA: Text that is written slowly, erases and writes another
There is the Typed which does what you are looking for, can set intervals in the typing time, line breaks, etc. In readme of the project there is more information on how to customize it, if need be.…
-
6
votes2
answers16310
viewsA: How to find an address by latitude and longitude
Use the API geolocation provided by Google: https://maps.googleapis.com/maps/api/geocode/output?parameters The output sets the response format, either JSON or XML. The parameters depend on the type…
-
2
votes1
answer89
viewsA: How to change background-position property?
Use backgroundPosition: document.querySelector('div').style.backgroundPosition = '50% 50%'; div { background: url(http://i.stack.imgur.com/c9dbY.jpg) no-repeat; height: 200px; width: 200px }…
javascriptanswered Renan Gomes 19,011 -
1
votes2
answers6432
viewsA: How to enable and disable links successively?
Another way to resolve it is to disable the link through the property pointer-events of CSS with value none. About this property, in MDN it is explained that: The CSS property pointer-events allows…
-
2
votes3
answers2529
viewsA: Using the Google Maps API for certain Longitude and Latitude
It is not necessary to make a request to the server with latitude and longitude. You can take the values (with Javascript) of the new location and only update the map through the function panTo().…
-
5
votes1
answer569
viewsA: How to reformulate radio and checkbox UI?
If we analyze the semantics of the names "check-box" and "radio-button" we will see the following: Check-box. English box (box box) selection/marking (check in). The traditional idea of this type of…
-
2
votes1
answer931
viewsA: Effects for menu with CSS3
You can use the technique of having a label attached to a field checkbox to control when the menu will be opened/closed, in that other answer I gave an example and explained a little better. In your…
-
3
votes2
answers677
viewsA: Center vertically DIV without fixed height in CSS
If you are going to consider using flexbox, as in your example, a solution is to use the property align-items: html, body { margin: 0; height: 100%; width: 100% } body { align-items: center;…
-
2
votes4
answers2128
viewsA: How to create a custom context menu?
The way I know how to create a custom context menu is, prevent the default behavior of the browser and "draw" the menu options with HTML and CSS. For example:…
-
5
votes1
answer103
viewsA: Identar and colorize VB.Net code
There is the Highlight, a Javascript library: <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/default.min.css"> <script…
-
1
votes2
answers218
viewsA: Enable Jquery
If you are using code that makes use of jQuery, it needs to be loaded before any other resource that uses it as dependency. In the Jsfiddle, this seems irrelevant because just import a resource and…
jqueryanswered Renan Gomes 19,011 -
2
votes2
answers1404
viewsA: Take another element’s background-color
Using only CSS, I don’t see any solution outside the suggestions they gave in the comments: Use a class containing the specific rules that the element should have. But I think that still would not…
css3answered Renan Gomes 19,011 -
3
votes2
answers865
viewsA: Create octagonal border button using html and css only
Try with SVG: body { background-color: #FBA323 } .svg-button path { fill: transparent; stroke: #fff; stroke-width: 2px } .svg-button tspan { fill: #fff } <svg class='svg-button'> <a…
-
6
votes3
answers713
viewsA: How to update page title with notifications?
The problem is, you’re probably picking up the title again every time you update it. That’s why the (1) (1) ... You can save the document title to a variable as soon as you run the script and keep…
javascriptanswered Renan Gomes 19,011 -
10
votes6
answers3120
viewsA: How can we not allow numbers in a textbox?
An alternative to the solutions presented is to block only the sending of the form with the validation attributes HTML5, not the user input. In fact, there is no way to guarantee that the entered…
-
3
votes2
answers200
viewsA: How do I show the description of a T-shirt when I click on it?
Although it has already been answered, I would like to add a solution without the use of Javascript. Which consists of using a field of type checkbox to create the effect of toggle. Forgetting a…
-
3
votes1
answer181
viewsA: How to download and import android v7-appcompat bookstore to Netbeans?
As for download, on the Android website for developers there is a guide explaining in detail how to download. After downloading, to make use of it, expand the project tree in the Netbeans IDE and:…
-
5
votes4
answers9539
viewsA: How to convert a string to date or date?
There is the DateTimeFormatter. Using it it is possible to convert a string into an object LocalDate, which is part of the new Java Date API, an example: String data = "13 Janeiro 2016";…
javaanswered Renan Gomes 19,011