Questions tagged as 'javascript'

2
answers

How to perform an action when reaching certain height of the scroll?

I have a function in which every time I give scroll it calls a certain function, only I want to call it only once $(window).on('scroll', function(e){ //aparece segundo menu if($(this).scrollTop() >= navHeight + section...
asked by 02.01.2015 / 20:02
1
answer

How to sort an array of numbers from largest to smallest?

The sort function exists, but it sorts from the smallest to the largest, and I'd like to sort from highest to lowest. Is there any function in javascript for this? Code with sort : var numeros = [200,100,400,900,600,700]; numer...
asked by 15.06.2014 / 16:37
2
answers

Is there a jQuery selector that takes the html of its own tag and also the content?

Example: <div id="quadro" style="float:left"> <h1>Quadro de horários</h1> </div> If I use $("#quadro").html() I only get h1, but I want the html of h1 and the div itself. I need something dynam...
asked by 12.08.2015 / 15:47
2
answers

Calculate values in real R $

Can anyone help me calculate the values in cents, transforming the value 1.6 into 1.60 . Code: $(document).ready(function () { var $entrada = 0, $saida = 0, $total = 0; $.each($("td[name='entrada']"), fu...
asked by 06.05.2015 / 02:06
3
answers

What is the meaning of this definition of values?

<script type="text/javascript"> perfBar.init({ budget: { // the key is the metric id 'loadTime': { max: 200 }, 'redirectCount': { max: 1 }, 'globalJS': {...
asked by 11.06.2015 / 15:46
2
answers

How to show only the date without the time with Date ()

I'm setting a date to be displayed in an input, this will be today's date minus one day, but I need only the date and you're showing me Date and Time, how can I do it? What I have so far is this: var Hoje = new Date(); Hoje.setDate(Hoje.ge...
asked by 24.11.2017 / 12:50
2
answers

Implement this

There are several divs with class .categorias and I need to display the .nav-a element only in the div category that I have with the mouse on it at the moment. What's happening now is that when I hover over any of the% d and...
asked by 10.07.2014 / 19:16
4
answers

How do I call a function by pressing Enter on an input

I'm creating a chat for a site and I need the user to just hit enter and the message appears in chat , this function usually works with a field textarea but with input no. HTML <form action="" method="post" id="fr...
asked by 04.02.2014 / 16:18
5
answers

How do I make the textarea automatically increase to a certain limit?

I'd like to know how best to make textarea increase automatically to the limit of 500px when the user enters content.    Do not use another library besides Jquery . CSS: textearea{ resize: none; /* impede que o...
asked by 07.04.2014 / 05:45
1
answer

Javascript documentation documentation standard and automatic generation of documentation in IDEs and exportable

Java has Javadoc, PHP has PHPDoc and other languages, has documentation standards. Which standard is most commonly used to document javascript , already integrated to IDEs, so that when using functions, it auto-complete the c...
asked by 11.02.2014 / 19:06