Questions tagged as 'jquery'

1
answer

How do I get the position of a certain element in a list through a specific attr?

I have a UL with some items. For example <ul class='ordemQuestoes'> <li idquestao="28" >Questao 28</li> <li idquestao="2" >Questao 2</li> <li idquestao="17" >Questao 17</li> </ul>...
asked by 28.11.2014 / 19:19
1
answer

$ .getJSON does not write return on variables

I created a function that takes the values of a JSON and (should send those values to variables inside the function) so I could use these variables in the continuation of the function. The problem is that when I run the function it does not retu...
asked by 12.09.2014 / 20:12
2
answers

Ideal attribute to not be 'clickable'

Good afternoon. I'm making a button that has the function of increasing the amount of products in the cart. However, by clicking many times on it, the element becomes as 'colored' as if it were a word or something. as in this image: The...
asked by 16.08.2017 / 20:23
2
answers

Division greater than R $ 999.00 results in NaN. How to format correctly

Division smaller than $ 999.00 works correctly. However, greater than $ 999.00 results in NaN. How to stir it? I already put a replace and nothing! $(document).ready(function() { var demo1 = $('span.ecwid-productBrowser-price-value');...
asked by 01.09.2017 / 20:57
2
answers

How to read a JSON file without a server?

I'm developing a simple static website with html, css and javascript hosted in Dropbox, using javascript with the JQuery framework and trying to read a JSON file. var jqxhr = $.getJSON( "example.json", function() { console.log( "success" );...
asked by 12.10.2015 / 02:45
3
answers

How to sort elements of the DOM by jQuery?

Suppose I have the following list: <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> </ul> I want all elements of even numbers to be ordered, so that the pairs are first, an...
asked by 11.08.2015 / 16:08
2
answers

How to create a function and call its methods without using new, similar to jQuery $?

The $ (dollar sign) of jQuery is a function , however you can access its methods as if it were an object through the "." . Could someone explain, in what way I could do this in a function func , for example? In a more enlighten...
asked by 28.11.2017 / 12:53
3
answers

Change date="" value of tooltips if they are displayed at resolution lower than 767px?

I'm implementing some tooltips in a contact form I'm developing. It turns out that when loaded at a lower resolution (below 767px), the tooltips is cut off. This is because tooltips has had their direction set by data-mytooltip-direc...
asked by 24.10.2016 / 07:34
6
answers

Turn result combining function into a dynamic function

I have a function that generates all possible combinations of numbers from 1 to 10. The combinations are 4 numbers, ie each combination has 4 different numbers. Ex: [1,2,3,4], [1,2,3,5], [1,2,3,6] ... [7,8,9,10]; I can specify the range of...
asked by 04.09.2014 / 22:44
3
answers

Execute function for each class you find

I'm creating a picture gallery within thumbnails by automatically setting them where I use the calculation below: if($('.thumb img').width()<$('.thumb img').height()){//portrait $('.thumb img').css({ maxWidth:'100%' }); $('.thu...
asked by 16.12.2013 / 17:45