Posts by Sam • 79,597 points
3,121 posts
-
0
votes2
answers342
viewsA: Enable/Disable SELECT field
You can use a Event Listener .change() to listen to changes in the first select and change the second. But see that you’re wearing the same id and name in both selects. This is incorrect because a…
-
0
votes1
answer90
viewsA: Space between needless animals
Dude, you need to remove the default upper margin that the ul have, so you will not need to make the gambiara to use a negative margin on the images of social networks pulling them up. One of the…
-
2
votes1
answer73
viewsA: How to keep the layout on the left side fixed, while the content on the right side is scrolled on the page
You could make Section responsive using the function calc() in the value of width, by deducting the width of the menu from 300px of the total width of the screen: width: calc(100% - 300px); Note…
-
1
votes2
answers90
viewsA: How to change div 3 inline images to only 2 inline images for tablet mode
You can put all Divs within one, instead of splitting. For example, you put all Divs .imagem_e_texto_outras_atracoes within a single div .outras_atracoes. On the Divs .imagem_e_texto_outras_atracoes…
-
1
votes2
answers370
viewsA: Alignment of same input Row using form validation
The estate justify-content: space-between; positions the two elements at each end of the div (in your case, vertical ends). By your CSS, you are applying it to the direct daughter Ivs of the form,…
-
1
votes1
answer151
viewsA: How to hold an event about a radio button value inside a modal?
I’ll leave a solution here even though the button doesn’t make sense "Continue" to be the submit (since there is no form for submit). Just create a Event Listener of click on the "Continue" button…
-
2
votes2
answers253
viewsA: Check if a string matches multiple conditions
Use the .test() Javascript to check if the string snippet has a character other than a number 0-9, because if there is a point, or the signs + and -, It’s not just numbers anymore. But see that the…
-
0
votes1
answer280
viewsA: Responsive menu with Bootstrap
Playing the code here, I didn’t notice any problem in the burger menu, but in the case of the footer, just remove the classes d-none and d-md-block of the third div inside the footer. The class…
-
2
votes1
answer46
viewsA: How do I change the color of the chart’s input values?
You can change using ticks/fontColor inside the Axes you want (in this case, the Y): yAxes: [{ display: true, gridLines: { color: '#fff' }, ticks: { fontColor: 'white' // aqui branco }, }] Behold:…
-
0
votes1
answer29
viewsA: Responsiveness in iframes
To make it responsive, use the event onresize in the object window sending the iframe to the function resizeIframe, just as you did in the attribute onload. Only instead of sending this, can select…
-
1
votes1
answer35
viewsA: How to Get the validated Jquery property
Use the method .rules() of Validate to remove or add the required to the field. You can do this with the method .change() select. For example, the code elemento.rules("remove", "required") removes…
javascriptanswered Sam 79,597 -
0
votes1
answer31
viewsA: How to adapt so that all <li> items pull a different div?
It will go wrong even because the script is out of the loop and the last value of <?=$situacoes_layout_classes[$situacao->id_situacao];?> will only get the last related div. Also note that…
-
3
votes1
answer54
viewsA: Find a string
You can do it with the method .susbtr(0,2) (first two characters) and with .length (returns the string size). Seria: if(lines[line].substr(0,2) == "N3" && lines[line].length == 32){ //…
javascriptanswered Sam 79,597 -
1
votes1
answer86
viewsA: Validate form attributes and submit data with Jquery
How you can cancel the Submit action from the com form event.preventDefault() within the attribute onsubmit: onsubmit="cadastrar(); event.preventDefault()" What is happening is that the form is…
-
1
votes1
answer179
viewsA: How do you get inside the Modal as the data in the database leaves input checkbox (checked)?
Since you have not shown modal HTML code with checkboxes, whereas checkboxes have value with the letters of the words (e.g., value="C" to "Cut"), just convert the value of data-whatever array with…
-
3
votes3
answers1081
viewsA: How to put a <p> on the same line as <hr>
I would use a container div with flexbox and apply flex: 1 in the hr for it to occupy the remaining width of the div where the text is not. And a margin-left to give a spacing. And instead of edge,…
-
2
votes1
answer158
viewsA: Read file line by line and collect strings
The code doesn’t work because you created an event change within the function doc() that does nothing the first time the function is called. And even if it worked, would error because you are not…
-
1
votes1
answer227
viewsA: Modal Jquery/ Materialize not working in index.php
Use: $('#modalCookie').modal().modal('open'); First you start the plugin and then trigger the method open that opens the modal. Watch out for the id modal. In jQuery you are using a id other than…
-
0
votes1
answer76
viewsA: Create a pure JS count
It’s easier to use setInterval, because it’s a continuous timer, which you can stop it with clearInterval(). But you need to assign it to a variable. If you have inside a function, just call the…
-
1
votes2
answers65
viewsA: Button appear only after you see all carousel slides
Add a specific class to the already viewed slide (for example, .visto) and not to be confused with another class used on the page. The class .visto will only be used in the indicators. When you call…
-
0
votes1
answer63
viewsA: Display an image when another image is not loaded
You can use the attribute onerror in the tag itself. This attribute will execute a code if there is a failure to load the image, and this code can be changed by src image by the default image you…
-
1
votes1
answer162
viewsA: fill table with javascript and ajax!
The function .append() serves to add content. In your case, if you want to place a content replacing, by chance, one that already exists, you can use one of two functions, depending on the content…
-
1
votes1
answer323
viewsA: Unwanted line break in PHP output
Use Javascript . Trim() function in return: data.trim() O . Trim() eliminates spaces on the edges of the string.
-
2
votes1
answer107
viewsA: Remove edge of Owl-Carousel button
That’s not edge, that’s the background of the buttons. You can remove by placing background: none !important; in the rules: .owl-prev, .owl-next, .owl-next:focus, .owl-prev:focus Enjoy and add in…
-
0
votes3
answers1919
viewsA: Align CSS Bootstrap Cards
Put the class .justify-content-center in div.row where are the cards so that they are aligned to the center. A div.row is already flexbox and this class, native to Bootstrap 4, aligns the child…
-
0
votes1
answer51
viewsA: How to use show/Hide inside a PHP foreach?
You are repeating the id="password-field" in various inputs. With this the code considers only the first one you find. Remember that the same id cannot be repeated on the same page, it must be…
-
3
votes1
answer93
viewsA: How to do div with scroll, when it reaches a certain limit of div height?
The problem is you’re putting position: absolute paragraphs. This causes them to be "loose" on the page and will not obey the overflow rule. Nor does it need the <br> between paragraphs. Only…
-
1
votes1
answer259
viewsA: Bootstrap’s alert to disappear
Place the property in CSS display: none in class .alertaLogin: .alertaLogin{ display: none; } Then the code that shows/hides the div after the return of AJAX and after you enter the error alert div:…
-
1
votes2
answers622
viewsA: How to Split Javascript using multiple tabs and without removing them?
Use capture group so that the regex characters in the split are included in the resulting array. Just include regex by concatenating between parentheses (). For example, the regex /,/ in the…
-
0
votes4
answers87
viewsA: Show/Hide Information by clicking
You can do it this way using the .one() that triggers the click event only 1 time. Even works for multiple elements: $(function() { $(".btn-toggle").click(function(){ var data =…
-
2
votes4
answers1891
viewsA: Sum of pairs typed interval
Since the variable i loop is incremented in +2 beginning from 0, it makes no sense to use a if to verify that the number is even, because i will always be par. And you are using the return in the…
-
0
votes1
answer59
viewsA: Is there any way to style the resize button?
You can use the jQuery UI Draggable for this. Instead of using the property resize: both;, you place a stylized element as you like in the lower right corner of the div by applying the draggable to…
-
0
votes2
answers68
viewsA: How to show and hide a list
If you are loading jQuery, you can do it using library codes: <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <!DOCTYPE html> <html>…
-
2
votes1
answer229
viewsA: My code is showing this error. [Object Htmlinputelement] Nan [Object Nodelist]
Missing to catch the .value of the elements. And in the case of radiobuttons you should put a value in each one, type: value="Importado" and value="Nacional" respectively. And to get the radio value…
javascriptanswered Sam 79,597 -
1
votes2
answers131
viewsA: How to load Lightbox2 when entering the page
The code you tried to use, shown in the question and copied from an issue of the gringo site does not seem to me to be what you need. The code only checks if the browser address bar URL has a hash…
-
1
votes1
answer65
viewsA: Message from the validate datetimepicker
The problem is that Validator creates a label with the error message after the input to be validated, and how you put a div with the calendar icon after input, the label created will be between…
-
0
votes1
answer34
viewsA: Pure CSS drop box
It’s because the submenu should have position: absolute;, that is, to be positioned in an absolute way so as not to influence the other fraternal elements. But it is also necessary to put position:…
-
0
votes1
answer115
viewsA: button to return to the beginning of the page
The element with position: fixed must have a property top or bottom, if it is not without the browser window reference. Like the properties top and bottom of every element has the default value…
-
2
votes1
answer255
viewsA: How to define an image, coming from the database and stored in binary, as background-image of a div?
If it was a normal URL, the value of url in the background-image it does not need to be enclosed by quotation marks, but in the case of Base64 it is necessary to. Like the values of style of the div…
-
0
votes3
answers156
viewsA: Return the first working day of the month
If it does not matter if the first "working day" of the month is a holiday, then you just want to know if today is neither Saturday nor Sunday, because these two days, whether a holiday or not, are…
javascriptanswered Sam 79,597 -
0
votes1
answer92
viewsA: How do I open the body width of the modal-Fill-in using css
There is a way to make the modal self-adjusting to the content, IE, it will have the width of the buttons, which will be next to each other; and if the screen is smaller, a button goes down the…
-
1
votes1
answer177
viewsA: How to get the database id of each TD from the html table
The problem is that you are repeating the id id="subject" and passing the data from AJAX. So you will always catch the first id="subject" page. An id must be unique, but you don’t need to do this,…
-
1
votes1
answer116
viewsA: How to highlight a table element from the JS
You can scan the table cells by looking for the text that matches the drawn number. Create a class in CSS that changes the cell background color to red, for example: .marcado{ background-color: red;…
-
2
votes2
answers304
viewsA: How to get components beyond the standards in Fullcalendar?
You take the value of the extra keys in the property event.extendedProps. For example, to take the value of STATUS you would use: event.extendedProps.STATUS…
-
1
votes1
answer65
viewsA: Marking a checkbox as selected
First you need to create a collection of the images (which you call "banner") by placing a class on them (e.g.. class="banners"): <img class="banners"…
-
0
votes1
answer28
viewsA: Add jquery line without changing previous value
Is that you are using a general class on the dial: $('.rule-choose-plan-doctor').empty().append(plans); This will change all elements with the class .rule-choose-plan-doctor. You would have to pick…
-
1
votes2
answers358
views -
1
votes4
answers330
viewsA: Create "dark" function on the site!
I would do differently, using CSS classes and just a function to switch between themes. Just create in CSS the two classes, .dark and .light: .dark{ background: #212121 center center no-repeat; }…
-
1
votes1
answer225
viewsA: How do I leave an option like "default" on a combobox?
Before making the append of options, put a if to insert the attribute selected option whose value is 9: if(jsonRespostaCTI.itens[i].key == 9) opt.setAttribute("selected", ""); Will result in HTML:…
-
1
votes1
answer63
viewsA: Add delay/timeout to a . Hover()
Placing an event inside the other is not good practice because calling the first will create multiple listeners of the second. For example, when calling mouseover, will create multiple .hover(),…