Posts by Bruno Calza • 1,096 points
19 posts
-
1
votes3
answers432
viewsA: Conditional for verification
If you prefer a Jquery solution, you can use $.inArray() if ($.inArray(x, [1,3,5,6,7,9,10]) !== -1){ console.log('Sim'); }else if($.inArray(x, [2,4,8,11,12,17]) !== -1){ console.log('Não'); }…
-
1
votes2
answers453
viewsA: Find div with attribute value equal to the one selected with jquery
You can select the image using the class .img and the attribute itself data-slide. To select the image 3: $('.img[data-slide="3"]'); To select the image corresponding to the button, simply:…
jqueryanswered Bruno Calza 1,096 -
2
votes2
answers372
viewsA: PHP in_array() function
I believe that a do-while resolve: $categoriasAnuncioAtual = explode(',', $rowCategoriasAnuncioAtual->anuc_cat_id); do{ $categoriaRandomAtual =…
-
2
votes7
answers44529
viewsA: How to get only the numbers of a string in Javascript?
You can use isNaN to check if the variable is not a number, isNaN(num) // retorna true se num não contém num número válido combined with the function filter, as follows…
-
1
votes1
answer305
viewsA: Correct syntax for SELECT and INNER JOIN in Zend
The third parameter of Join tells you what table values you want to bring. If you don’t pass any value, it brings them all. That’s why it exists poi.* in the final result. If you don’t want to bring…
-
3
votes2
answers19079
viewsA: Find Scroll Position of a Particular Object
Utilize offset to find the object’s position $("#meuobjeto_id").offset().top And compare the $(window).scrollTop() with the value obtained. You can do something like $(window).scroll(function(){ if…
-
6
votes2
answers9366
viewsA: How to split an image into multiple parts with link?
I believe you can do this using background-image and background-position, as follows: <a href="link" class="img parte1"></a> <a href="link" class="img parte2"></a> <a…
-
2
votes1
answer155
viewsA: Query calculating dates with INNER JOIN
You need a alias in the select internal. Anyway, your query is wrong. TABLE_1.data makes no sense inside the select internal. Try something like SELECT date_format(TABLE_2.data, '%d/%m/%Y %H:%i:%s')…
-
13
votes2
answers5339
viewsA: Remove empty positions from an array
You can use the function filter, as follows: var m_prod = [5, , , , , , , , , ,6 , , , ]; var resultado = m_prod.filter(function(ele){ return ele !== undefined; }); console.log(resultado); // [5,6]…
-
7
votes2
answers69
viewsA: Problem with the font property
According to MDN The order of the values is not completely free: font-style, font-Variant and font-Weight must be defined, if any, before the font-size value. The line-height value must be defined…
cssanswered Bruno Calza 1,096 -
3
votes1
answer3036
viewsA: How to send more than one value in a select element of the html form?
What you have done is not wrong. It is very common to separate values by , as well. But I believe the most appropriate way is to spend a JSON. You can pass using vector notation as <select…
-
3
votes1
answer551
viewsA: Select products in a certain range of discounted values?
I believe the function COALESCE solve your problem. COALESCE(promocoes.desconto,0) returns 0 case promocoes.desconto be it null. Now, in fact, your structure seems a little messy. Promotion and…
-
5
votes2
answers3368
viewsA: Multiple variable declaration in Javascript
There are many arguments in favor of both sides ranging from automatic semicolon insertion, Hoisting and readability until "this is easier to do diff than that". In the end it all comes down to…
-
2
votes1
answer1632
viewsA: Warning: array_filter() expects at Most 2 Parameters, 3 Given
Of documentation of function array_filter: 5.6.0 Added optional flag Parameter and constants ARRAY_FILTER_USE_KEY and ARRAY_FILTER_USE_BOTH Your PHP version does not support the third argument from…
-
4
votes1
answer60
viewsA: Question about "Parent" in Jquery
You forgot the parentheses after the parent. An alternative to avoid this amount of parent is to use parents as follows: $(this).parents('.pai').find('.horarios').show();…
jqueryanswered Bruno Calza 1,096 -
6
votes2
answers18126
viewsA: Open DIV after clicking a Link Button
Your question is very broad and can be solved in many ways. Always try to post part of the code you’re working on so we can better help you. I’ll give you some guidelines. HTML HTML should be very…
-
3
votes1
answer53
viewsA: Fade out on the mother div but not on your kids with jQuery
The only way to do this is by removing the internal nodes from the navBar from within the navBar. One way is to add them after the navBar when the animation is over:…
-
2
votes2
answers119
viewsA: Put jQuery function on button
You will need a call AJAX to the server to check whether or not the database entry exists. The return of this call may be a JSON indicating whether the entry exists or not. Generic code of what you…
-
20
votes2
answers23421
viewsA: Is there any way to dynamically put a mask in php?
You can use vsprintf as follows: function format($mask,$string) { return vsprintf($mask, str_split($string)); } Example: $cnpjMask = "%s%s.%s%s%s.%s%s%s/%s%s%s%s-%s%s"; echo…
phpanswered Bruno Calza 1,096